summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-04-08 16:05:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:04:00 -0500
commit4a61e4901ebc751fea57880424f9045e3bdf238e (patch)
tree98f0c68e041de8d0001a9d3dd996b0790e1473e8
parent69979ddc6e6a5b36f710ec6155b50c00568f68cf (diff)
downloadsamba-4a61e4901ebc751fea57880424f9045e3bdf238e.tar.gz
samba-4a61e4901ebc751fea57880424f9045e3bdf238e.tar.bz2
samba-4a61e4901ebc751fea57880424f9045e3bdf238e.zip
r14999: Remove more unused autoconf code
Simplify va_copy() replacement code a bit (This used to be commit a5c87360a7f14a90b831ea372277f4f89ee4c5f1)
-rw-r--r--source4/build/m4/rewrite.m421
-rw-r--r--source4/configure.in1
-rw-r--r--source4/include/includes.h2
-rw-r--r--source4/lib/appweb/mpr/miniMpr.c12
-rw-r--r--source4/lib/replace/replace.h16
-rw-r--r--source4/lib/talloc/talloc.c18
-rw-r--r--source4/lib/util/dprintf.c2
-rw-r--r--source4/lib/util/select.c2
-rw-r--r--source4/lib/util/util_file.c2
-rw-r--r--source4/lib/util/xfile.c2
10 files changed, 22 insertions, 56 deletions
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 8b82d89e31..c65c82345d 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -8,7 +8,6 @@ AC_SUBST(LDSHFLAGS)
AC_SUBST(SONAMEFLAG)
AC_SUBST(PICFLAG)
-AC_DEFINE([_GNU_SOURCE],[],[Pull in GNU extensions])
AC_SYS_LARGEFILE
#
@@ -53,7 +52,7 @@ AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/select.h fcntl.h sys/fcntl.h sys/time.h stdarg.h)
-AC_CHECK_HEADERS(utime.h grp.h sys/id.h limits.h memory.h compat.h math.h)
+AC_CHECK_HEADERS(utime.h grp.h sys/id.h limits.h compat.h math.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h)
AC_CHECK_HEADERS(sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
@@ -496,21 +495,3 @@ fi
AC_CHECK_LIB_EXT(crypt, CRYPT_LIBS, crypt)
SMB_EXT_LIB_ENABLE(CRYPT,YES)
SMB_EXT_LIB(CRYPT, $CRYPT_LIBS)
-
-##
-## moved after the check for -lcrypt in order to
-## ensure that the necessary libraries are included
-## check checking for truncated salt. Wrapped by the
-## $with_pam_for_crypt variable as above --jerry
-##
-if test x"$with_pam_for_crypt" != x"yes"; then
-AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
-crypt_LIBS="$LIBS"
-LIBS="$AUTHLIBS $LIBS"
-AC_TRY_RUN([#include "${srcdir-.}/build/tests/crypttest.c"],
- samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
-LIBS="$crypt_LIBS"])
-if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
- AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
-fi
-fi
diff --git a/source4/configure.in b/source4/configure.in
index 9214884767..9e5f97ca5c 100644
--- a/source4/configure.in
+++ b/source4/configure.in
@@ -27,7 +27,6 @@ sinclude(lib/ldb/sqlite3.m4)
sinclude(lib/ldb/config.m4)
sinclude(lib/tls/config.m4)
sinclude(lib/events/config.m4)
-sinclude(lib/cmdline/config.m4)
dnl disabled until we support external heimdal again
dnl sinclude(auth/kerberos/config.m4)
diff --git a/source4/include/includes.h b/source4/include/includes.h
index a79a48f377..77f0b02010 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -64,6 +64,8 @@
#endif
#endif
+#define _GNU_SOURCE /* Use GNU extensions */
+
/* mark smb_panic() as noreturn, so static analysers know that it is
used like abort */
_PUBLIC_ void smb_panic(const char *why) NORETURN_ATTRIBUTE;
diff --git a/source4/lib/appweb/mpr/miniMpr.c b/source4/lib/appweb/mpr/miniMpr.c
index f4c219fe4c..8df1817bf1 100644
--- a/source4/lib/appweb/mpr/miniMpr.c
+++ b/source4/lib/appweb/mpr/miniMpr.c
@@ -330,13 +330,7 @@ static int mprCoreStrcat(int alloc, char **destp, int destMax, int existingLen,
dest = *destp;
sepLen = (delim) ? strlen(delim) : 0;
-#ifdef HAVE_VA_COPY
va_copy(ap, args);
-#elif HAVE___VA_COPY
- __va_copy(ap, args);
-#else
- ap = args;
-#endif
addBytes = 0;
str = src;
while (str) {
@@ -371,13 +365,7 @@ static int mprCoreStrcat(int alloc, char **destp, int destMax, int existingLen,
}
if (addBytes > 0) {
-#ifdef HAVE_VA_COPY
va_copy(ap, args);
-#elif HAVE___VA_COPY
- __va_copy(ap, args);
-#else
- ap = args;
-#endif
str = src;
while (str) {
strcpy(dp, str);
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index 20b73e5b84..f68c5b23a9 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -134,18 +134,16 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#define slprintf snprintf
-#ifdef HAVE_VA_COPY
-#define VA_COPY(dest, src) va_copy(dest, src)
-#elif defined(HAVE___VA_COPY)
-#define VA_COPY(dest, src) __va_copy(dest, src)
+#ifndef HAVE_VA_COPY
+#ifdef HAVE___VA_COPY
+#define va_copy(dest, src) __va_copy(dest, src)
#else
-#define VA_COPY(dest, src) (dest) = (src)
+#define va_copy(dest, src) (dest) = (src)
+#endif
#endif
-#if defined(HAVE_VOLATILE)
-#define VOLATILE volatile
-#else
-#define VOLATILE
+#ifndef HAVE_VOLATILE
+#define volatile
#endif
#ifndef HAVE_COMPARISON_FN_T
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 99ede462b8..8f046a02b8 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -999,13 +999,11 @@ char *talloc_strndup(const void *t, const char *p, size_t n)
return ret;
}
-#ifndef VA_COPY
-#ifdef HAVE_VA_COPY
-#define VA_COPY(dest, src) va_copy(dest, src)
-#elif defined(HAVE___VA_COPY)
-#define VA_COPY(dest, src) __va_copy(dest, src)
+#ifndef HAVE_VA_COPY
+#ifdef HAVE___VA_COPY
+#define va_copy(dest, src) __va_copy(dest, src)
#else
-#define VA_COPY(dest, src) (dest) = (src)
+#define va_copy(dest, src) (dest) = (src)
#endif
#endif
@@ -1016,7 +1014,7 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
va_list ap2;
char c;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
/* this call looks strange, but it makes it work on older solaris boxes */
if ((len = vsnprintf(&c, 1, fmt, ap2)) < 0) {
@@ -1025,7 +1023,7 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
ret = _talloc(t, len+1);
if (ret) {
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
vsnprintf(ret, len+1, fmt, ap2);
talloc_set_name_const(ret, ret);
}
@@ -1067,7 +1065,7 @@ char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
tc = talloc_chunk_from_ptr(s);
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
s_len = tc->size - 1;
if ((len = vsnprintf(NULL, 0, fmt, ap2)) <= 0) {
@@ -1083,7 +1081,7 @@ char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
s = talloc_realloc(NULL, s, char, s_len + len+1);
if (!s) return NULL;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
vsnprintf(s+s_len, len+1, fmt, ap2);
talloc_set_name_const(s, s);
diff --git a/source4/lib/util/dprintf.c b/source4/lib/util/dprintf.c
index 916db3af93..62dc2a227a 100644
--- a/source4/lib/util/dprintf.c
+++ b/source4/lib/util/dprintf.c
@@ -38,7 +38,7 @@ _PUBLIC_ int d_vfprintf(FILE *f, const char *format, va_list ap) _PRINTF_ATTRIBU
va_list ap2;
/* do any message translations */
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
ret = vasprintf(&p, format, ap2);
diff --git a/source4/lib/util/select.c b/source4/lib/util/select.c
index a1b2e04065..4f906f2454 100644
--- a/source4/lib/util/select.c
+++ b/source4/lib/util/select.c
@@ -32,7 +32,7 @@
static pid_t initialised;
static int select_pipe[2];
-static VOLATILE unsigned pipe_written, pipe_read;
+static volatile unsigned pipe_written, pipe_read;
/*******************************************************************
Call this from all Samba signal handlers if you want to avoid a
diff --git a/source4/lib/util/util_file.c b/source4/lib/util/util_file.c
index 3f6a6b3a40..8d8e7c6ec9 100644
--- a/source4/lib/util/util_file.c
+++ b/source4/lib/util/util_file.c
@@ -371,7 +371,7 @@ _PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) _PRINTF_ATTRIBUTE
int len, ret;
va_list ap2;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
len = vasprintf(&p, format, ap2);
if (len <= 0) return len;
diff --git a/source4/lib/util/xfile.c b/source4/lib/util/xfile.c
index 97bab2ef9a..1cf77a3220 100644
--- a/source4/lib/util/xfile.c
+++ b/source4/lib/util/xfile.c
@@ -202,7 +202,7 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f)
int len, ret;
va_list ap2;
- VA_COPY(ap2, ap);
+ va_copy(ap2, ap);
len = vasprintf(&p, format, ap2);
if (len <= 0) return len;