]> git.sur5r.net Git - bacula/bacula/commitdiff
- Modify configure.in to check for typeof().
authorKern Sibbald <kern@sibbald.com>
Sun, 4 Jun 2006 12:15:44 +0000 (12:15 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 4 Jun 2006 12:15:44 +0000 (12:15 +0000)
- 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

bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/kes-1.38
bacula/kes-1.39
bacula/src/findlib/attribs.c
bacula/src/lib/alist.h
bacula/src/lib/dlist.h
bacula/src/lib/parse_conf.h

index 87af24d6afea49f4cb7c6e9a39cc895575ddd463..1ebb5a81d42f403f6b0fc2d6abffae45979748c3 100644 (file)
 /* 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
index 12a6cfbd374a7dac3fad42f092b9a63d82a19e54..d033b15fe5ee6575536353a6c6e7a1fef4e1deac 100644 (file)
@@ -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
 
index 4c4f13612b5ea72b0ef84ea6f612c64571f2b1d3..280fdce058ccaa9bfbed0e29565806fe0b499ec1 100755 (executable)
@@ -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
index e0eb4acdb683b7fce88ed834197597cc3af879a3..b9a436cce06b1d6c1e970b58472598299e80e054 100644 (file)
@@ -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.
index 83aa5031d2f2950242c399b22d9da7719a910468..2bb7f944659d452633e0d03c22958b26970152ae 100644 (file)
@@ -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
index b709cb9f446c54b6176000966c913d5a9aec6f24..3988eae7aa79418b545fab231ace632290e99f0c 100755 (executable)
@@ -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 <class T> void plug(T &st, uint64_t val)
-    { st = static_cast<T>(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 <class T> void plug(T &st, uint64_t val)
+      { st = static_cast<T>(val); }
+  #endif
 #endif
 
-
 /* Decode a stat packet from base64 characters */
 int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI)
 {
index e8645b58e0b59a389910a19f32f9d52ec9d01ca3..dcdf809d4f171692008f61035521870a2aa14701 100644 (file)
@@ -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
index aa858bee974cd9927a9a3f4fa86270fd921ab87f..2644158ef8d5ee78e6bea40cccbebf629dd6434f 100644 (file)
@@ -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
index 3b35a2ca18a7c2a3b52ce992b8a49dddb1faedcd..eca7aaa35b23d4352831bb0e74e3f4c3200c4549 100644 (file)
@@ -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