Skip to content

Commit

Permalink
Add VACopy check...
Browse files Browse the repository at this point in the history
  • Loading branch information
Sapd committed Feb 20, 2024
1 parent 8860a8d commit 2a957ab
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,40 @@ configure_file(
@ONLY
)

# ------------------------------------------------------------------------------
# VA Copy check for asprintf
# ------------------------------------------------------------------------------

# Check for va_copy
include(CheckCSourceCompiles)

check_c_source_compiles("
#include <stdarg.h>
int main() {
va_list x, y;
va_copy(x, y);
return 0;
}
" HAVE_VA_COPY)

if(HAVE_VA_COPY)
add_definitions(-DHAVE_VA_COPY=1)
endif()

# Check for __va_copy
check_c_source_compiles("
#include <stdarg.h>
int main() {
va_list x, y;
__va_copy(x, y);
return 0;
}
" HAVE___VA_COPY)

if(HAVE___VA_COPY)
add_definitions(-DHAVE___VA_COPY=1)
endif()

# ------------------------------------------------------------------------------
# Clang format
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 2a957ab

Please sign in to comment.