]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
introduce STDTIME_ON_32BITS
authorFrancis Dupont <fdupont@isc.org>
Fri, 18 Mar 2011 09:00:45 +0000 (09:00 +0000)
committerFrancis Dupont <fdupont@isc.org>
Fri, 18 Mar 2011 09:00:45 +0000 (09:00 +0000)
lib/dns/masterdump.c
lib/isc/unix/include/isc/stdtime.h
lib/isc/win32/include/isc/stdtime.h

index 9a31c0000e15f5f23c9491d6ed2046449d8ac0c3..b069e4012304f2bbe1756a1ecee446a958546f1a 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: masterdump.c,v 1.104 2011/03/11 06:11:23 marka Exp $ */
+/* $Id: masterdump.c,v 1.105 2011/03/18 09:00:44 fdupont Exp $ */
 
 /*! \file */
 
@@ -1387,23 +1387,24 @@ dumptostreaminc(dns_dumpctx_t *dctx) {
                        isc_buffer_region(&buffer, &r);
                        isc_buffer_putuint32(&buffer, dns_masterformat_raw);
                        isc_buffer_putuint32(&buffer, DNS_RAWFORMAT_VERSION);
-                       if (sizeof(now32) != sizeof(dctx->now)) {
-                               /*
-                                * We assume isc_stdtime_t is a 32-bit integer,
-                                * which should be the case on most cases.
-                                * If it turns out to be uncommon, we'll need
-                                * to bump the version number and revise the
-                                * header format.
-                                */
-                               isc_log_write(dns_lctx,
-                                             ISC_LOGCATEGORY_GENERAL,
-                                             DNS_LOGMODULE_MASTERDUMP,
-                                             ISC_LOG_INFO,
-                                             "dumping master file in raw "
-                                             "format: stdtime is not 32bits");
-                               now32 = 0;
-                       } else
-                               now32 = dctx->now;
+#if !defined(STDTIME_ON_32BITS) || (STDTIME_ON_32BITS + 0) != 1
+                       /*
+                        * We assume isc_stdtime_t is a 32-bit integer,
+                        * which should be the case on most cases.
+                        * If it turns out to be uncommon, we'll need
+                        * to bump the version number and revise the
+                        * header format.
+                        */
+                       isc_log_write(dns_lctx,
+                                     ISC_LOGCATEGORY_GENERAL,
+                                     DNS_LOGMODULE_MASTERDUMP,
+                                     ISC_LOG_INFO,
+                                     "dumping master file in raw "
+                                     "format: stdtime is not 32bits");
+                       now32 = 0;
+#else
+                       now32 = dctx->now;
+#endif
                        isc_buffer_putuint32(&buffer, now32);
                        INSIST(isc_buffer_usedlength(&buffer) <=
                               sizeof(rawheader));
index 4cb9e81fa60cd58861fabed796333d7845772974..6c31c0d219a5a1dc9650c194fd661f7e73ed87f9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: stdtime.h,v 1.14 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: stdtime.h,v 1.15 2011/03/18 09:00:44 fdupont Exp $ */
 
 #ifndef ISC_STDTIME_H
 #define ISC_STDTIME_H 1
  * about its size.
  */
 typedef isc_uint32_t isc_stdtime_t;
+
+/* but this flag helps... */
+#define STDTIME_ON_32BITS      1
+
 /*
  * isc_stdtime32_t is a 32-bit version of isc_stdtime_t.  A variable of this
  * type should only be used as an opaque integer (e.g.,) to compare two
index 4f9eb74c54b6c3003f35c47727870f3653284695..b5e89cf74dce972c491c6a451f2c110599e17bc7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: stdtime.h,v 1.12 2007/06/19 23:47:20 tbox Exp $ */
+/* $Id: stdtime.h,v 1.13 2011/03/18 09:00:45 fdupont Exp $ */
 
 #ifndef ISC_STDTIME_H
 #define ISC_STDTIME_H 1
  * about its size.
  */
 typedef isc_uint32_t isc_stdtime_t;
+
+/* but this flag helps... */
+#define STDTIME_ON_32BITS      1
+
 /*
  * isc_stdtime32_t is a 32-bit version of isc_stdtime_t.  A variable of this
  * type should only be used as an opaque integer (e.g.,) to compare two