Skip to content

Commit

Permalink
build (windows): define ssize_t more consistently, skip test_clear
Browse files Browse the repository at this point in the history
Based on a patch by Khachik Shahzadyan <[email protected]>
  • Loading branch information
jgriffiths committed Nov 26, 2024
1 parent 531914f commit ccf3efc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 8 additions & 1 deletion _cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
# endif
#endif

#if defined (_WIN32) && !defined(_SSIZE_T_DECLARED) && !defined(_ssize_t) && !defined(ssize_t)
#if defined(_WIN64)
typedef __int64 ssize_t;
#else
typedef long ssize_t;
#endif
#endif

#include "ccan_config.h"
#endif /*LIBWALLYCORE_CONFIG_H*/
#endif /* LIBWALLYCORE_CONFIG_H */
8 changes: 6 additions & 2 deletions src/amalgamation/windows_config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@

#define HAVE_UNALIGNED_ACCESS 1

#if (!defined(_SSIZE_T_DECLARED)) && (!defined(_ssize_t)) && (!defined(ssize_t))
#define ssize_t long long
#if defined (_WIN32) && !defined(_SSIZE_T_DECLARED) && !defined(_ssize_t) && !defined(ssize_t)
#if defined(_WIN64)
typedef __int64 ssize_t;
#else
typedef long ssize_t;
#endif
#endif

#include "ccan_config.h"
Expand Down
10 changes: 6 additions & 4 deletions src/ctest/_CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ target_include_directories(test_bech32 PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(test_bech32 PRIVATE wallycore)
add_test(test_bech32 test_bech32)

add_executable(test_clear test_clear.c)
target_include_directories(test_clear PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(test_clear PRIVATE wallycore pthread)
add_test(test_clear test_clear)
if(NOT WIN32)
add_executable(test_clear test_clear.c)
target_include_directories(test_clear PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(test_clear PRIVATE wallycore pthread)
add_test(test_clear test_clear)
endif()

add_executable(test_coinselection test_coinselection.c)
target_include_directories(test_coinselection PRIVATE ${CMAKE_BINARY_DIR})
Expand Down

0 comments on commit ccf3efc

Please sign in to comment.