On Sun, Jun 01, 2008 at 03:20:00PM +0200, Bengt Nilsson wrote:
> If I change to int32_t in the corresponding source files, it all  
> compiles but it does not link:

It compiled with the attached patch.

I don't know why the compiler isn't able to optimize away
the safe_string stuff.

Volker
diff --git a/source/include/safe_string.h b/source/include/safe_string.h
index d278e29..826a571 100644
--- a/source/include/safe_string.h
+++ b/source/include/safe_string.h
@@ -79,7 +79,7 @@ size_t __unsafe_string_function_usage_here_size_t__(void);
 
 size_t __unsafe_string_function_usage_here_char__(void);
 
-#ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
+#if 0
 
 /* if the compiler will optimize out function calls, then use this to tell if we are 
    have the correct types (this works only where sizeof() returns the size of the buffer, not
@@ -172,7 +172,7 @@ size_t __unsafe_string_function_usage_here_char__(void);
 #define alpha_strcpy(dest,src,other_safe_chars,maxlength) alpha_strcpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE,dest,src,other_safe_chars,maxlength)
 #define StrnCpy(dest,src,n)		StrnCpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE,dest,src,n)
 
-#ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
+#if 0
 
 /* if the compiler will optimize out function calls, then use this to tell if we are 
    have the correct types (this works only where sizeof() returns the size of the buffer, not
diff --git a/source/lib/replace/libreplace_cc.m4 b/source/lib/replace/libreplace_cc.m4
index 74c53ca..4ac08e8 100644
--- a/source/lib/replace/libreplace_cc.m4
+++ b/source/lib/replace/libreplace_cc.m4
@@ -105,25 +105,34 @@ AC_CHECK_HEADERS([standards.h])
 # Solaris needs HAVE_LONG_LONG defined
 AC_CHECK_TYPES(long long)
 
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
 AC_CHECK_TYPE(uint_t, unsigned int)
 AC_CHECK_TYPE(int8_t, char)
 AC_CHECK_TYPE(uint8_t, unsigned char)
 AC_CHECK_TYPE(int16_t, short)
 AC_CHECK_TYPE(uint16_t, unsigned short)
+
+if test $ac_cv_sizeof_int -eq 4 ; then
+AC_CHECK_TYPE(int32_t, int)
+AC_CHECK_TYPE(uint32_t, unsigned int)
+elif test $ac_cv_size_long -eq 4 ; then
 AC_CHECK_TYPE(int32_t, long)
 AC_CHECK_TYPE(uint32_t, unsigned long)
+else
+AC_MSG_ERROR([LIBREPLACE no 32-bit type found])
+fi
+
 AC_CHECK_TYPE(int64_t, long long)
 AC_CHECK_TYPE(uint64_t, unsigned long long)
 
 AC_CHECK_TYPE(size_t, unsigned int)
 AC_CHECK_TYPE(ssize_t, int)
 
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
 AC_CHECK_SIZEOF(off_t)
 AC_CHECK_SIZEOF(size_t)
 AC_CHECK_SIZEOF(ssize_t)
diff --git a/source/libaddns/dns.h b/source/libaddns/dns.h
index 4862a23..be22760 100644
--- a/source/libaddns/dns.h
+++ b/source/libaddns/dns.h
@@ -29,6 +29,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_INT32_FROM_RPC_RPC_H
+#include <rpc/rpc.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>

Attachment: pgpD1bFucFcYN.pgp
Description: PGP signature

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Reply via email to