Skip to content

Commit

Permalink
add DLL version to help debug stale DLL problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddie Wu committed Jul 7, 2016
1 parent 3693b5d commit b623d3d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
###############################################################################
* text=auto

#######################################
# @ref http://stackoverflow.com/questions/16524225/how-can-i-populate-the-git-commit-id-into-a-file-when-i-commit
#######################################
version.cpp ident

###############################################################################
# Set default behavior for command prompt diff.
#
Expand Down
2 changes: 2 additions & 0 deletions kdb+/kdb+.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ extern "C" {

KDB_API K K_DECL cwd(K/*NOTE: at least one argument required by 2:!*/);

KDB_API K K_DECL version(K/*NOTE: at least one argument required by 2:!*/);

# ifndef NDEBUG
KDB_API K K_DECL testSerial(K);
# endif
Expand Down
9 changes: 9 additions & 0 deletions kdb+/kdb+.q
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

DLL:hsym`$"kdb+";

// DLL version
version:DLL 2:(`version;1);

/==============================================================================
\d .text

Expand All @@ -12,6 +15,12 @@ utf8_gb18030:lineOrList[;.CPPlib.DLL 2:(`utf8_gb18030;1)];

stringize:{x _.Q.s y}$[.z.o like"w*";2;1]

/==============================================================================
\d .os

// Current Working Directory
cwd:.CPPlib.DLL 2:(`cwd;1);

/==============================================================================
\d .opt

Expand Down
1 change: 1 addition & 0 deletions kdb+/kdb+.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ IF EXIST $(SolutionDir)..\..\lib\ (
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="test.cpp" />
<ClCompile Include="version.cpp" />
</ItemGroup>
<ItemGroup>
<Text Include="kdb+.q">
Expand Down
3 changes: 3 additions & 0 deletions kdb+/kdb+.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@
<ClCompile Include="test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions kdb+/version.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "stdafx.h"
#include "kdb+.h"

#include <string>

KDB_API K K_DECL version(K _) {
std::string const ver("$Id$");
return kp(const_cast<S>(ver.c_str()));
}

0 comments on commit b623d3d

Please sign in to comment.