diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 9a31c0000e..b069e40123 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -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)); diff --git a/lib/isc/unix/include/isc/stdtime.h b/lib/isc/unix/include/isc/stdtime.h index 4cb9e81fa6..6c31c0d219 100644 --- a/lib/isc/unix/include/isc/stdtime.h +++ b/lib/isc/unix/include/isc/stdtime.h @@ -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 @@ -31,6 +31,10 @@ * 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 diff --git a/lib/isc/win32/include/isc/stdtime.h b/lib/isc/win32/include/isc/stdtime.h index 4f9eb74c54..b5e89cf74d 100644 --- a/lib/isc/win32/include/isc/stdtime.h +++ b/lib/isc/win32/include/isc/stdtime.h @@ -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 @@ -29,6 +29,10 @@ * 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