From 3b07f6aeb1a060efcf8218e76b8b84fb8850f337 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 5 Oct 2007 12:05:40 +0000 Subject: r25515: Revert r25448: Immediate structures are *not* supportet by the native C compiler at least on Solaris, Tru64 and HP-UX. Michael (This used to be commit 6d07e29de2a7e535139622fa688b407da232c816) --- source4/build/smb_build/env.pm | 4 ++++ source4/lib/replace/libreplace_cc.m4 | 4 ++-- source4/libcli/util/ntstatus.h | 6 ++++++ source4/libcli/util/werror.h | 8 +++++++- source4/librpc/ndr/libndr.h | 1 - 5 files changed, 19 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/build/smb_build/env.pm b/source4/build/smb_build/env.pm index 548d04f841..f468f51de1 100644 --- a/source4/build/smb_build/env.pm +++ b/source4/build/smb_build/env.pm @@ -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: $!"); diff --git a/source4/lib/replace/libreplace_cc.m4 b/source4/lib/replace/libreplace_cc.m4 index bd92867d6d..a01bf1b290 100644 --- a/source4/lib/replace/libreplace_cc.m4 +++ b/source4/lib/replace/libreplace_cc.m4 @@ -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 diff --git a/source4/libcli/util/ntstatus.h b/source4/libcli/util/ntstatus.h index 84d924c2ec..026b5162db 100644 --- a/source4/libcli/util/ntstatus.h +++ b/source4/libcli/util/ntstatus.h @@ -29,9 +29,15 @@ 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. */ diff --git a/source4/libcli/util/werror.h b/source4/libcli/util/werror.h index 3cd76816dc..0f49514b9f 100644 --- a/source4/libcli/util/werror.h +++ b/source4/libcli/util/werror.h @@ -19,7 +19,7 @@ */ #ifndef _WERROR_H_ -#define _WERROR_H_ +#define _WERROR_H #include @@ -29,9 +29,15 @@ 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)) diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index d110a25aeb..5b9089fc6d 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -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; -- cgit