From 2ac649e09ddccfdd771b4db93e624ec9537c8bf6 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 8 Apr 2009 04:33:29 +0000 Subject: [PATCH] - Added a va_copy/__va_copy check to CMakeLists.txt. SVN r1526 (trunk) --- src/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ccaef349..d8025b3b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -151,6 +151,23 @@ else( WIN32 ) include_directories( ${FPU_CONTROL_DIR} ) add_definitions( -DHAVE_FPU_CONTROL ) endif( FPU_CONTROL_DIR ) + + include( CheckCXXSourceCompiles ) + CHECK_CXX_SOURCE_COMPILES( + "#include + int main() { va_list list1, list2; va_copy(list1, list2); return 0; }" + HAS_VA_COPY ) + if( NOT HAS_VA_COPY ) + CHECK_CXX_SOURCE_COMPILES( + "#include + int main() { va_list list1, list2; __va_copy(list1, list2); return 0; }" + HAS___VA_COPY ) + if( HAS___VA_COPY ) + add_definitions( -Dva_copy=__va_copy ) + else( HAS___VA_COPY ) + message( SEND_ERROR "Compiler does not support va_copy or __va_copy" ) + endif( HAS___VA_COPY ) + endif( NOT HAS_VA_COPY ) endif( WIN32 ) # Decide on the name of the FMOD library we want to use.