Remove undocumented plinth function mps_lib_assert_fail_expr and rewrite assertp macro to call documented plinth function mps_lib_assert_fail instead.

Copied from Perforce
 Change: 192941
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2017-03-04 11:17:11 +00:00
parent e9df5d6a35
commit b9ae05b94f
3 changed files with 10 additions and 19 deletions

View file

@ -1,7 +1,7 @@
/* check.h: ASSERTION INTERFACE
*
* $Id$
* Copyright (c) 2001-2016 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2017 Ravenbrook Limited. See end of file for license.
* Portions copyright (C) 2002 Global Graphics Software.
*
* .aver: This header defines a family of AVER and NOTREACHED macros.
@ -56,9 +56,10 @@
mps_lib_assert_fail(MPS_FILE, __LINE__, (condstring)); \
END
#define ASSERTP(cond, condstring, dflt) \
(LIKELY(cond) ? (dflt) : \
mps_lib_assert_fail_expr(MPS_FILE, __LINE__, condstring, dflt))
#define ASSERTP(cond, condstring, default_) \
((void)(LIKELY(cond) \
|| (mps_lib_assert_fail(MPS_FILE, __LINE__, (condstring)), FALSE)), \
(default_))
#define ASSERT_ISTYPE(type, val) (type ## Check(val))
#define ASSERT_TYPECHECK(type, val) \
@ -373,7 +374,7 @@ extern unsigned CheckLevel;
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2016 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2017 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* mpslib.h: RAVENBROOK MEMORY POOL SYSTEM LIBRARY INTERFACE
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2017 Ravenbrook Limited. See end of file for license.
*
* .readership: MPS client application developers, MPS developers.
* .sources: <design/lib/>
@ -44,7 +44,6 @@ extern int mps_lib_fputs(const char *, mps_lib_FILE *);
environment it can return and the MPS will attempt to continue, though
this may cause failure of the process soon after. */
extern void mps_lib_assert_fail(const char *, unsigned, const char *);
extern void *mps_lib_assert_fail_expr(const char *, unsigned, const char *, void *);
/* The default ANSI plinth in mpsliban.c allows the assertion handler to be
replaced by passing a replacement to `mps_lib_assert_fail_install`,
@ -79,7 +78,7 @@ extern unsigned long mps_lib_telemetry_control(void);
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2017 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*

View file

@ -1,7 +1,7 @@
/* mpsliban.c: RAVENBROOK MEMORY POOL SYSTEM LIBRARY INTERFACE (ANSI)
*
* $Id$
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2017 Ravenbrook Limited. See end of file for license.
* Portions copyright (c) 2002 Global Graphics Software.
*
* .purpose: The purpose of this code is
@ -87,15 +87,6 @@ void mps_lib_assert_fail(const char *file,
mps_lib_assert_handler(file, line, condition);
}
extern void *mps_lib_assert_fail_expr(const char *file,
unsigned line,
const char *condition,
void *p)
{
mps_lib_assert_fail(file, line, condition);
return p;
}
mps_lib_assert_fail_t mps_lib_assert_fail_install(mps_lib_assert_fail_t handler)
{
mps_lib_assert_fail_t old_handler = mps_lib_assert_handler;
@ -215,7 +206,7 @@ unsigned long mps_lib_telemetry_control(void)
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* Copyright (C) 2001-2017 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*