Author: jelmer Date: 2005-09-24 14:58:18 +0000 (Sat, 24 Sep 2005) New Revision: 10476
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10476 Log: Move some more types to libreplace. Fix missing strndup errors for heimdal Modified: branches/SAMBA_4_0/source/SConstruct branches/SAMBA_4_0/source/build/m4/check_types.m4 branches/SAMBA_4_0/source/heimdal_build/config.h branches/SAMBA_4_0/source/heimdal_build/config.m4 branches/SAMBA_4_0/source/lib/replace/README branches/SAMBA_4_0/source/lib/replace/SConscript branches/SAMBA_4_0/source/lib/replace/config.m4 branches/SAMBA_4_0/source/lib/replace/replace.h Changeset: Modified: branches/SAMBA_4_0/source/SConstruct =================================================================== --- branches/SAMBA_4_0/source/SConstruct 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/SConstruct 2005-09-24 14:58:18 UTC (rev 10476) @@ -136,30 +136,6 @@ # Pull in GNU extensions defines['_GNU_SOURCE'] = 1 - needed_types = { - 'uint_t': 'unsigned int', - 'int8_t': 'signed char', - 'uint8_t': 'unsigned char', - 'int16_t': 'short', - 'uint16_t': 'unsigned short', - 'int32_t': 'long', - 'uint32_t': 'unsigned long', - 'int64_t': 'long long', - 'uint64_t': 'unsigned long long' - } - - type_headers = """ -#include <stdint.h> -#include <sys/types.h> -""" - for t in needed_types: - if not conf.CheckType(t,type_headers): - defines[t] = needed_types[t] - - for t in ['u_int32_t', 'u_int16_t', 'u_int8_t']: - if conf.CheckType(t, type_headers): - defines['HAVE_%s' % string.upper(t)] = 1 - if conf.CheckType('comparison_fn_t', '#include <stdlib.h>'): defines['HAVE_COMPARISON_FN_T'] = 1 Modified: branches/SAMBA_4_0/source/build/m4/check_types.m4 =================================================================== --- branches/SAMBA_4_0/source/build/m4/check_types.m4 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/build/m4/check_types.m4 2005-09-24 14:58:18 UTC (rev 10476) @@ -28,12 +28,4 @@ AC_MSG_ERROR([Sorry we need sizeof(long long) >= 8]) fi AC_CHECK_TYPE(_Bool) -AC_CHECK_TYPE(uint_t, unsigned int) -AC_CHECK_TYPE(int8_t, signed char) -AC_CHECK_TYPE(uint8_t, unsigned char) -AC_CHECK_TYPE(int16_t, short) -AC_CHECK_TYPE(uint16_t, unsigned short) -AC_CHECK_TYPE(int32_t, long) -AC_CHECK_TYPE(uint32_t, unsigned long) -AC_CHECK_TYPE(int64_t, long long) -AC_CHECK_TYPE(uint64_t, unsigned long long) + Modified: branches/SAMBA_4_0/source/heimdal_build/config.h =================================================================== --- branches/SAMBA_4_0/source/heimdal_build/config.h 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/heimdal_build/config.h 2005-09-24 14:58:18 UTC (rev 10476) @@ -55,4 +55,8 @@ #define OPENLOG_PROTO_COMPATIBLE #define GETSOCKNAME_PROTO_COMPATIBLE +#ifndef HAVE_STRNDUP +#define HAVE_STRNDUP #endif + +#endif Modified: branches/SAMBA_4_0/source/heimdal_build/config.m4 =================================================================== --- branches/SAMBA_4_0/source/heimdal_build/config.m4 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/heimdal_build/config.m4 2005-09-24 14:58:18 UTC (rev 10476) @@ -213,10 +213,6 @@ AC_PROG_LEX AC_PROG_YACC -AC_CHECK_TYPES(u_int32_t) -AC_CHECK_TYPES(u_int16_t) -AC_CHECK_TYPES(u_int8_t) - # to enable kerberos, unpack a heimdal source tree in the heimdal directory # of the samba source tree if test -d heimdal; then Modified: branches/SAMBA_4_0/source/lib/replace/README =================================================================== --- branches/SAMBA_4_0/source/lib/replace/README 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/lib/replace/README 2005-09-24 14:58:18 UTC (rev 10476) @@ -51,6 +51,10 @@ Types: socklen_t +u_int{8,16,32}_t +uint_t +uint{8,16,32,64}_t +int{8,16,32,64}_t Prerequisites: memset (for bzero) Modified: branches/SAMBA_4_0/source/lib/replace/SConscript =================================================================== --- branches/SAMBA_4_0/source/lib/replace/SConscript 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/lib/replace/SConscript 2005-09-24 14:58:18 UTC (rev 10476) @@ -4,7 +4,7 @@ if hostenv['configure']: conf = Configure(hostenv) for f in ['memset','syslog','setnetgrent','getnetgrent','endnetgrent', \ - 'mktemp']: + 'mktemp', 'memcpy']: if not conf.CheckFunc(f,'c'): print "Required function `%s' not found" % f exit(1) @@ -26,6 +26,29 @@ if not conf.CheckType('socklen_t'): defines['socklen_t'] = 'int' + needed_types = { + 'uint_t': 'unsigned int', + 'int8_t': 'signed char', + 'uint8_t': 'unsigned char', + 'u_int8_t': 'unsigned char', + 'int16_t': 'short', + 'uint16_t': 'unsigned short', + 'u_int16_t': 'unsigned short', + 'int32_t': 'long', + 'uint32_t': 'unsigned long', + 'u_int32_t': 'unsigned long', + 'int64_t': 'long long', + 'uint64_t': 'unsigned long long', + } + + type_headers = """ +#include <stdint.h> +#include <sys/types.h> +""" + for t in needed_types: + if not conf.CheckType(t,type_headers): + defines[t] = needed_types[t] + conf.Finish() hostenv.StaticLibrary('repdir', ['repdir/repdir.c']) Modified: branches/SAMBA_4_0/source/lib/replace/config.m4 =================================================================== --- branches/SAMBA_4_0/source/lib/replace/config.m4 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/lib/replace/config.m4 2005-09-24 14:58:18 UTC (rev 10476) @@ -1,3 +1,16 @@ +AC_CHECK_TYPE(uint_t, unsigned int) +AC_CHECK_TYPE(int8_t, signed char) +AC_CHECK_TYPE(uint8_t, unsigned char) +AC_CHECK_TYPE(int16_t, short) +AC_CHECK_TYPE(uint16_t, unsigned short) +AC_CHECK_TYPE(int32_t, long) +AC_CHECK_TYPE(uint32_t, unsigned long) +AC_CHECK_TYPE(int64_t, long long) +AC_CHECK_TYPE(uint64_t, unsigned long long) +AC_CHECK_TYPE(u_int32_t, unsigned long) +AC_CHECK_TYPE(u_int16_t, unsigned short) +AC_CHECK_TYPE(u_int8_t, unsigned char) + AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[ AC_TRY_RUN([ #include <stdio.h> @@ -99,5 +112,5 @@ AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) LIBS="$SAVE_LIBS" -AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent],, - [AC_MSG_ERROR([Need syslog and memset])]) +AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],, + [AC_MSG_ERROR([Required function not found])]) Modified: branches/SAMBA_4_0/source/lib/replace/replace.h =================================================================== --- branches/SAMBA_4_0/source/lib/replace/replace.h 2005-09-24 13:10:19 UTC (rev 10475) +++ branches/SAMBA_4_0/source/lib/replace/replace.h 2005-09-24 14:58:18 UTC (rev 10476) @@ -132,18 +132,6 @@ typedef int (*comparison_fn_t)(const void *, const void *); #endif -#ifndef HAVE_U_INT32_T -typedef unsigned u_int32_t; -#endif - -#ifndef HAVE_U_INT16_T -typedef unsigned short u_int16_t; -#endif - -#ifndef HAVE_U_INT8_T -typedef unsigned char u_int8_t; -#endif - #ifdef HAVE_DLFCN_H #include <dlfcn.h> #endif
