Skip to content

Commit

Permalink
lib: msgpack: use linux-atomic workaround only on Linux
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Jan 18, 2017
1 parent 0977f3b commit 5a38a9d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/msgpack-c-0b7cabd/Files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ LIST (APPEND msgpackc_SOURCES

# Fluent Bit fix for ARM without __sync calls support
include (CheckCSourceCompiles)
check_c_source_compiles("
int main() {
__sync_sub_and_fetch(\"\", 1);
return 0;
}" FLB_HAVE_SYNC_SUB)
if(NOT FLB_HAVE_SYNC_SUB)
LIST (APPEND msgpackc_SOURCES
src/linux-atomic.c
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
check_c_source_compiles("
int main() {
__sync_sub_and_fetch(\"\", 1);
return 0;
}" FLB_HAVE_SYNC_SUB)
if(NOT FLB_HAVE_SYNC_SUB)
LIST (APPEND msgpackc_SOURCES
src/linux-atomic.c
)
endif()
endif()

LIST (APPEND msgpackc_HEADERS
Expand Down

0 comments on commit 5a38a9d

Please sign in to comment.