2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

expand on why magic numbers need to be first in the structure

This commit is contained in:
Michael Graff
2000-05-11 16:18:01 +00:00
parent 9dff010bd0
commit 3ee8ba5e32

View File

@@ -25,7 +25,10 @@ typedef struct {
/* /*
* To use this macro the magic number MUST be the first thing in the * To use this macro the magic number MUST be the first thing in the
* structure, and MUST be of type "unsigned int" * structure, and MUST be of type "unsigned int".
*
* The intent of this is to allow magic numbers to be checked even though
* the object is otherwise opaque.
*/ */
#define ISC_MAGIC_VALID(a,b) (((a) != NULL) \ #define ISC_MAGIC_VALID(a,b) (((a) != NULL) \
&& (((isc__magic_t *)(a))->magic == (b))) && (((isc__magic_t *)(a))->magic == (b)))