Skip to content

Commit

Permalink
Changed __VERSION__ to __LIBVER__ to avoid clashing with GCC predefs.
Browse files Browse the repository at this point in the history
  • Loading branch information
trcwm committed Aug 1, 2017
1 parent 85c69ab commit 310058e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD 11)


# library version
add_definitions(-D__VERSION__="v0.01")
add_definitions(-D__LIBVER__="v0.01")

# determine number of bits of compiler
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
Expand Down
6 changes: 3 additions & 3 deletions common/libmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ DLLPUBLIC CapResult Cap_setAutoProperty(CapContext ctx, CapStream stream, CapPro

DLLPUBLIC const char* Cap_getLibraryVersion()
{
#ifndef __VERSION__
#define __VERSION__ "VERSION UNKNOWN"
#ifndef __LIBVER__
#define __LIBVER__ "VERSION UNKNOWN"
#endif

#ifndef __PLATFORM__
Expand All @@ -305,7 +305,7 @@ DLLPUBLIC const char* Cap_getLibraryVersion()
#define __BUILDTYPE__ "BUILDTYPE UNKNOWN"
#endif

static const char versionString[] = __PLATFORM__ " " __BUILDTYPE__ " " __VERSION__ " " __DATE__ " ";
static const char versionString[] = __PLATFORM__ " " __BUILDTYPE__ " " __LIBVER__ " " __DATE__ " ";

return versionString;
}
2 changes: 1 addition & 1 deletion include/openpnp-capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ DLLPUBLIC void Cap_setLogLevel(uint32_t level);
When building the library, please set the
following defines in the build environment:
__VERSION__
__LIBVER__
__PLATFORM__
__BUILDTYPE__
Expand Down
2 changes: 2 additions & 0 deletions linux/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ int main(int argc, char*argv[])
uint32_t deviceID = 0;

printf("OpenPNP Capture Test Program\n");
printf("%s\n", Cap_getLibraryVersion());

Cap_setLogLevel(7);

if (argc >= 2)
Expand Down

0 comments on commit 310058e

Please sign in to comment.