diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-03-19 16:23:32 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-03-19 16:23:32 (GMT) |
commit | b97f4dff0e286abe9dfe6e9c14e988274541e974 (patch) | |
tree | f9f61465b68ecf2151c633ce8543db163aa58798 /src | |
parent | 30c94e0da4ffc0c7017c981b7305d855feea5441 (diff) |
If inttypes is not found (Visual Studio) some typedefs and defines need to be done
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/lib/tng_io.c | 3 | ||||
-rw-r--r-- | src/tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tests/tng_io_testing.c | 3 |
4 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index b6fd655..18cf32f 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,5 +1,9 @@ add_library(tng_io SHARED tng_io.c md5.c) +if(HAVE_INTTYPES_H) + set_target_properties(tng_io PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) +endif() + if(ZLIB_FOUND) set_target_properties(tng_io PROPERTIES COMPILE_DEFINITIONS USE_ZLIB=1) target_link_libraries(tng_io ${ZLIB_LIBRARIES}) diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 5971c30..82568e9 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -13,7 +13,10 @@ * of the License, or (at your option) any later version. */ +#ifdef USE_STD_INTTYPES_H #include <inttypes.h> +#endif + #include <limits.h> #include <stdlib.h> #include <string.h> diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 8ec785b..4a63c54 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -13,6 +13,10 @@ include_directories(${CMAKE_BINARY_DIR}/generated/) add_executable(tng_testing tng_io_testing.c) target_link_libraries(tng_testing tng_io) +if(HAVE_INTTYPES_H) + set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) +endif() + if(OPENMP_FOUND) add_executable(md_openmp md_openmp.c) target_link_libraries(md_openmp tng_io ${OpenMP_LIBS} m) diff --git a/src/tests/tng_io_testing.c b/src/tests/tng_io_testing.c index a8782f2..133a1fb 100644 --- a/src/tests/tng_io_testing.c +++ b/src/tests/tng_io_testing.c @@ -13,7 +13,10 @@ * of the License, or (at your option) any later version. */ +#ifdef USE_STD_INTTYPES_H #include <inttypes.h> +#endif + #include <stdlib.h> #include <string.h> #include <tng_io.h> |