From 75064ae95eb385e65d290f6f680ed729c6e2135b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Sep 2006 12:59:31 +0000 Subject: r18895: AIX need to call pidl with --uint-enums as the compiler doesn't like negative values in the generated code. I'm not sure how we can solve that in samba3 as the generated code is commited Maybe we need to alsways pass --uint-enums metze (This used to be commit 9468dcc5d564d7242d527eb770717e2b4480cf1c) --- source3/configure.in | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'source3/configure.in') diff --git a/source3/configure.in b/source3/configure.in index 0808729fa3..61a4e2e524 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -535,6 +535,38 @@ if test x"$samba_cv_volatile" = x"yes"; then AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) fi +############################################ +# check if the compiler can handle negative enum values +# and don't truncate the values to INT_MAX +# a runtime test is needed here +AC_SUBST(PIDL_ARGS) +AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [ + AC_TRY_RUN( +[ + #include + enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; + int main(void) { + enum negative_values v1 = NEGATIVE_VALUE; + unsigned v2 = NEGATIVE_VALUE; + + if (v1 != 0xFFFFFFFF) { + printf("%u != 0xFFFFFFFF\n", v1); + return 1; + } + if (v2 != 0xFFFFFFFF) { + printf("%u != 0xFFFFFFFF\n", v2); + return 1; + } + + return 0; + } +], + 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 + dnl Figure out the flags to support named structure initializers LIBREPLACE_C99_STRUCT_INIT([],[AC_MSG_ERROR([c99 structure initializer are not supported])]) -- cgit