r25515: Revert r25448:
authorMichael Adam <obnox@samba.org>
Fri, 5 Oct 2007 12:05:40 +0000 (12:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:07:46 +0000 (15:07 -0500)
Immediate structures are *not* supportet by the native C compiler
at least on Solaris, Tru64 and HP-UX.

Michael

source/build/smb_build/env.pm
source/lib/replace/libreplace_cc.m4
source/libcli/util/ntstatus.h
source/libcli/util/werror.h
source/librpc/ndr/libndr.h

index 548d04f841e917a4127ac6ae8f58234dad41b879..f468f51de1ed300ad3d8b28f8b04d3d3ec20e49d 100644 (file)
@@ -59,6 +59,10 @@ sub PkgConfig($$$$$$$$$$$$)
 
        print __FILE__.": creating $path\n";
 
+       if ($self->{config}->{libreplace_cv_immediate_structures} eq "yes") {
+               $cflags .= " -DHAVE_IMMEDIATE_STRUCTURES=1";
+       }
+
        mkpath(dirname($path),0,0755);
        open(OUT, ">$path") or die("Can't open $path: $!");
 
index bd92867d6dc471a9145b76f94f2ee8c2e7a0dde1..a01bf1b2904df87b2a5365bb10b8d2a462365b8c 100644 (file)
@@ -159,8 +159,8 @@ AC_CACHE_CHECK([for immediate structures],libreplace_cv_immediate_structures,[
        libreplace_cv_immediate_structures=no,
        libreplace_cv_immediate_structures=cross)
 ])
-if test x"$libreplace_cv_immediate_structures" = x"no"; then
-       AC_MSG_ERROR([compiler does not support immediate structures])
+if test x"$libreplace_cv_immediate_structures" = x"yes"; then
+       AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
 fi
 
 AC__LIBREPLACE_ONLY_CC_CHECKS_END
index 84d924c2ec5c9a4828076e9ee742b8b5036b7530..026b5162dbdd4bc2fa34d21b0a7a6640f030a951 100644 (file)
    from using bool for internal functions 
 */
 
+#if defined(HAVE_IMMEDIATE_STRUCTURES)
 typedef struct {uint32_t v;} NTSTATUS;
 #define NT_STATUS(x) ((NTSTATUS) { x })
 #define NT_STATUS_V(x) ((x).v)
+#else
+typedef uint32_t NTSTATUS;
+#define NT_STATUS(x) (x)
+#define NT_STATUS_V(x) (x)
+#endif
 
 /* Win32 Status codes. */
 
index 3cd76816dc2a0fd0d93ae8602aee493c1fd91a0f..0f49514b9fb4a961b1b776d2314ee7734d1cb746 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #ifndef _WERROR_H_
-#define _WERROR_H_
+#define _WERROR_H
 
 #include <stdint.h>
 
    from using bool for internal functions 
 */
 
+#if defined(HAVE_IMMEDIATE_STRUCTURES)
 typedef struct {uint32_t v;} WERROR;
 #define W_ERROR(x) ((WERROR) { x })
 #define W_ERROR_V(x) ((x).v)
+#else
+typedef uint32_t WERROR;
+#define W_ERROR(x) (x)
+#define W_ERROR_V(x) (x)
+#endif
 
 #define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
 #define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y))
index d110a25aeb706d8752f759936e19296f5ba09971..5b9089fc6d81f0e22a981e7e50f50ae0f1f99344 100644 (file)
@@ -285,7 +285,6 @@ typedef void (*ndr_print_fn_t)(struct ndr_print *, const char *, const void *);
 typedef void (*ndr_print_function_t)(struct ndr_print *, const char *, int, const void *);
 
 #include "librpc/gen_ndr/misc.h"
-#include "libcli/util/werror.h"
 #include "librpc/ndr/libndr_proto.h"
 
 extern const struct ndr_syntax_id ndr_transfer_syntax;