utils/magic_assert.h: separate assert.h and ASSERT

This is a low level thing that other lowlevel API (platform shims for
strlen_s() and ctime_r() want to make use of, without any application
global pollution).

Copyright date(s) taken from git blame information for moved lines.
This commit is contained in:
Darryl L. Miles 2024-10-14 22:04:05 +01:00 committed by R. Timothy Edwards
parent 4d2def46f4
commit 4a1da7fe7c
2 changed files with 35 additions and 7 deletions

View File

@ -29,6 +29,8 @@
#include <zlib.h>
#endif
#include "utils/magic_assert.h"
/* ------------------- Universal pointer typecast --------------------- */
/* Set default value for backwards compatibility with non-autoconf make */
@ -123,13 +125,6 @@ extern char *SysLibPath; /* Path for finding system
* files like color maps, styles, etc.
*/
/* --------------------- Debugging and assertions --------------------- */
/* To enable assertions, undefine NDEBUG in file defs.mak */
#include <assert.h>
#define ASSERT(p, where) assert(p) /* "where" is ignored */
/* ------------------------ Malloc/free ------------------------------- */
/*

33
utils/magic_assert.h Normal file
View File

@ -0,0 +1,33 @@
/*
* magic_assert.h --
*
* Debugging and assertions definitions for all MAGIC modules
*
* *********************************************************************
* * Copyright (C) 2017, 2024 Regents of the University of California. *
* * Permission to use, copy, modify, and distribute this *
* * software and its documentation for any purpose and without *
* * fee is hereby granted, provided that the above copyright *
* * notice appear in all copies. The University of California *
* * makes no representations about the suitability of this *
* * software for any purpose. It is provided "as is" without *
* * express or implied warranty. Export of this software outside *
* * of the United States of America may require an export license. *
* *********************************************************************
*
* rcsid="$Header"
*/
#ifndef _MAGIC_ASSERT_H
#define _MAGIC_ASSERT_H
/* --------------------- Debugging and assertions --------------------- */
/* To enable assertions, undefine NDEBUG in file defs.mak */
#include <assert.h>
#define ASSERT(p, where) assert(p) /* "where" is ignored */
#endif /* _MAGIC_ASSERT_H */