From: Kern Sibbald Date: Sun, 4 Jun 2006 12:15:44 +0000 (+0000) Subject: - Modify configure.in to check for typeof(). X-Git-Tag: Release-7.0.0~7958 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ded107306b8369baaf3f7fd377622524e7fec663;p=bacula%2Fbacula - Modify configure.in to check for typeof(). - In findlib/attribs.c use typeof instead of templates if possible. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3042 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 87af24d6af..1ebb5a81d4 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -670,6 +670,9 @@ /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH +/* Defind to 1 if compiler has typeof */ +#undef HAVE_TYPEOF + /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ #undef HAVE_TZNAME diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 12a6cfbd37..d033b15fe5 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1257,6 +1257,18 @@ AC_CACHE_CHECK([for bigendian], ba_cv_bigendian, [ba_cv_bigendian=no])]) test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN) +dnl# -------------------------------------------------------------------------- +dnl# Check for typeof() +dnl# -------------------------------------------------------------------------- +AC_LANG_PUSH(C++) +AC_CACHE_CHECK(for typeof, ba_cv_have_typeof, + [AC_TRY_RUN( + [main(){char *a = 0; a = (typeof a)a;}], + [ba_cv_have_typeof=yes], + [ba_cv_have_typeof=no], + [ba_cv_have_typeof=no])]) +test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof]) +AC_LANG_POP(C++) AC_C_CONST diff --git a/bacula/configure b/bacula/configure index 4c4f13612b..280fdce058 100755 --- a/bacula/configure +++ b/bacula/configure @@ -20737,6 +20737,65 @@ test $ba_cv_bigendian = yes && cat >>confdefs.h <<\_ACEOF _ACEOF +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +echo "$as_me:$LINENO: checking for typeof" >&5 +echo $ECHO_N "checking for typeof... $ECHO_C" >&6 +if test "${ba_cv_have_typeof+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ba_cv_have_typeof=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +main(){char *a = 0; a = (typeof a)a;} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ba_cv_have_typeof=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ba_cv_have_typeof=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ba_cv_have_typeof" >&5 +echo "${ECHO_T}$ba_cv_have_typeof" >&6 +test $ba_cv_have_typeof = yes && +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPEOF 1 +_ACEOF + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 diff --git a/bacula/kes-1.38 b/bacula/kes-1.38 index e0eb4acdb6..b9a436cce0 100644 --- a/bacula/kes-1.38 +++ b/bacula/kes-1.38 @@ -2,6 +2,54 @@ Kern Sibbald General: +01Jun06 +- Implement partial error messages for src/filed/acl.c +- Fix return code to fail when doing update barcodes and + Pool resource is not found. This previously caused Volumes + to be labeled as cleaning tapes. +- Small updates to projects file. +26May06 +- Prevent DVD code from rewriting label if the device cannot be + opened read/write. +- Used __GNUC__ to detect GNU g++ as suggested by John Goerzen to + fix Debian build bug. +- Fix Dir/SD run race in migrate.c, verify.c, and restore.c +- Update projects file. +24May06 +- Applied patch posted by Jaime Ventura to bug #570 to correct failure + of restarted jobs to complete (due to a destroyed pthreads conditional + variable used by the message thread). +- Fixed bug #619 where Bacula would not restart jobs with MaxRestartTimes + set to zero. +- Apply patch from John Goerzen bug #611 to fix bad manual links in the code. +- Apply patch from Rudolf Cejka bug #614 to removed trailing + colons in query.sql file. +- Apply patch from Rudolf Cejka bug #613 to correct prunning of files + not to create orphans. +- Apply patch from Rudolf Cejka bug #617 to use mtime instead of ctime + in restore long listing. +- Apply patch from Rudolf Cejka bug #609 to use MarkId in verify.c instead + of incorrect MarkedId. +- Apply patch from adioso bug #616 to correct text in manual (replace + Director with File daemon). +21May06 +- Move DIR "run" command to SD before starting the message thread + as suggested by Cristopher Hull to avoid a race deadlock from + two threads using the bsock structure. +- Modify LICENSE to correct some problems pointed out by Debian. +05May06 +- Correct EOF with no \n lex.c problem. +- Add additional INFO messages if autochanger cannot be used. +- Add Eric Bollengier's lex error handler fix, which corrects most + of the reload problems. + +Release 1.38.9 (02May06) released 02MayO6 +02May06 +- Added code to strip backslashes from Windows filenames during + a restore. +- Corrected Win32 License to use the correct LICENSE file. +- Corrected the buffer count and bytes reported in the heap + statistics. 26Apr06 - Implement an NT_() macro to indicate that text should NOT be translated. @@ -525,9 +573,9 @@ Changes to 1.38.1: 15 November 2005 - Fix copyright date and URL typo -- bug #468. - Change autostart install for FreeBSD to look for rc.conf rather than rc.local as suggested fix for bug #466. -- Apply patch supplied by Eric Bollengier to fix PostgreSQL +- Apply patch supplied by Eric Bollinger to fix PostgreSQL grant on status. Bug #465 -- Apply patch supplied by Eric Bollengier to fix PostgreSQL +- Apply patch supplied by Eric Bollinger to fix PostgreSQL update script. Bug #464 - Fix off by one for last Slot of autochanger for label. - Update release date. diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index 83aa5031d2..2bb7f94465 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -2,6 +2,9 @@ Kern Sibbald General: +04Jun06 +- Modify configure.in to check for typeof(). +- In findlib/attribs.c use typeof instead of templates if possible. 01Jun06 - Implement partial error messages for src/filed/acl.c - Fix return code to fail when doing update barcodes and @@ -69,6 +72,7 @@ General: - Correct EOF with no \n lex.c problem. - Tweak compat.h compat.cpp and merge with apcupsd - Add additional INFO messages if autochanger cannot be used. + 02May06 - Simplify Win32 Makefile - Correct count of buffers/bytes used by smartall.c diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index b709cb9f44..3988eae7aa 100755 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -206,14 +206,19 @@ void encode_stat(char *buf, FF_PKT *ff_pkt, int data_stream) /* Do casting according to unknown type to keep compiler happy */ -#if !HAVE_GCC & HAVE_SUN_OS -#define plug(st, val) st = val /* brain damaged compiler */ +#ifdef HAVE_TYPEOF + #define plug(st, val) st = (typeof st)val #else -template void plug(T &st, uint64_t val) - { st = static_cast(val); } + #if !HAVE_GCC & HAVE_SUN_OS + /* Sun compiler does not handle templates correctly */ + #define plug(st, val) st = val + #else + /* Use templates to do the casting */ + template void plug(T &st, uint64_t val) + { st = static_cast(val); } + #endif #endif - /* Decode a stat packet from base64 characters */ int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI) { diff --git a/bacula/src/lib/alist.h b/bacula/src/lib/alist.h index e8645b58e0..dcdf809d4f 100644 --- a/bacula/src/lib/alist.h +++ b/bacula/src/lib/alist.h @@ -26,7 +26,7 @@ * * Loop var through each member of list */ -#if defined(__GNUC__) +#ifdef HAVE_TYPEOF #define foreach_alist(var, list) \ for((var)=(typeof(var))(list)->first(); (var); (var)=(typeof(var))(list)->next() ) #else diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index aa858bee97..2644158ef8 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -36,7 +36,7 @@ * * Loop var through each member of list */ -#if defined(__GNUC__) +#ifdef HAVE_TYPEOF #define foreach_dlist(var, list) \ for((var)=NULL; ((var)=(typeof(var))(list)->next(var)); ) #else diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h index 3b35a2ca18..eca7aaa35b 100644 --- a/bacula/src/lib/parse_conf.h +++ b/bacula/src/lib/parse_conf.h @@ -109,7 +109,7 @@ void save_resource(int type, RES_ITEM *item, int pass); const char *res_to_str(int rcode); /* Loop through each resource of type, returning in var */ -#if defined(__GNUC__) +#ifdef HAVE_TYPEOF #define foreach_res(var, type) \ for((var)=NULL; ((var)=(typeof(var))GetNextRes((type), (RES *)var));) #else