Commit d99d0c19 authored by Francis Dupont's avatar Francis Dupont
Browse files

introduce STDTIME_ON_32BITS

parent 36383133
......@@ -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));
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment