From 1b3471ed0cf1f1ec2cdc8a116b1da93f783a47c6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 9 Jun 2005 07:51:58 +0000 Subject: r7425: configure check to see if a compiler can handle negative enum values if the compiler doesn't support it we pass --uint-enums to pidl metze (This used to be commit c52703c0a8adb4f64ec52e4bf602e9c17ef2c748) --- source4/build/m4/check_cc.m4 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/build/m4/check_cc.m4') diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 68e938b794..947112f4b6 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -67,6 +67,20 @@ if test x"$samba_cv_immediate_structures" = x"yes"; then AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) fi +############################################ +# check if the compiler can handle negative enum values +AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [ + AC_TRY_COMPILE([ +#include ], +[ + enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; +], + SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no)]) +if test x"$SMB_BUILD_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then + AC_MSG_WARN([using --unit-enums for pidl]) + PIDL_ARGS="$PIDL_ARGS --uint-enums" +fi + AC_MSG_CHECKING([for test routines]) AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"], AC_MSG_RESULT(yes), -- cgit