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:
@@ -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)))
|
||||||
|
Reference in New Issue
Block a user