* 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 */
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));
* 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
* 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