SCM_SYMBOL (sym_null_pointer_error, "null-pointer-error");
/* The cell representing the null pointer. */
-static const scm_t_bits null_pointer[2] =
- {
- scm_tc7_foreign | (SCM_FOREIGN_TYPE_VOID << 8UL),
- 0
- };
+static SCM null_pointer;
/* Raise a null pointer dereference error. */
static void
SCM_VALIDATE_FOREIGN (1, foreign);
- if (SCM_UNLIKELY (scm_is_eq (foreign, PTR2SCM (&null_pointer))))
+ if (SCM_UNLIKELY (scm_is_eq (foreign, null_pointer)))
/* Attempting to modify the pointer value of NULL_POINTER (which is
read-only anyway), so raise an error. */
null_pointer_error (FUNC_NAME);
#endif
);
- scm_define (sym_null, PTR2SCM (&null_pointer));
+ null_pointer = scm_cell (scm_tc7_foreign | (SCM_FOREIGN_TYPE_VOID << 8UL),
+ 0);
+ scm_define (sym_null, null_pointer);
}
void