You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
4.6 KiB
130 lines
4.6 KiB
5 years ago
|
diff --git a/openpgm/pgm/include/impl/messages.h b/openpgm/pgm/include/impl/messages.h
|
||
|
index 812393f..1655e9c 100644
|
||
|
--- a/openpgm/pgm/include/impl/messages.h
|
||
|
+++ b/openpgm/pgm/include/impl/messages.h
|
||
|
@@ -185,14 +185,14 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
#define pgm_warn_if_reached() \
|
||
|
do { \
|
||
|
pgm_warn ("file %s: line %d (%s): code should not be reached", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
||
|
+ __FILE__, __LINE__, __func__); \
|
||
|
} while (0)
|
||
|
#define pgm_warn_if_fail(expr) \
|
||
|
do { \
|
||
|
if (PGM_LIKELY (expr)); \
|
||
|
else \
|
||
|
pgm_warn ("file %s: line %d (%s): runtime check failed: (%s)", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
|
||
|
+ __FILE__, __LINE__, __func__, #expr); \
|
||
|
} while (0)
|
||
|
|
||
|
|
||
|
@@ -210,14 +210,14 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
if (PGM_LIKELY(expr)); \
|
||
|
else { \
|
||
|
pgm_fatal ("file %s: line %d (%s): assertion failed: (%s)", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
|
||
|
+ __FILE__, __LINE__, __func__, #expr); \
|
||
|
abort (); \
|
||
|
} \
|
||
|
} while (0)
|
||
|
# define pgm_assert_not_reached() \
|
||
|
do { \
|
||
|
pgm_fatal ("file %s: line %d (%s): should not be reached", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
||
|
+ __FILE__, __LINE__, __func__); \
|
||
|
abort (); \
|
||
|
} while (0)
|
||
|
# define pgm_assert_cmpint(n1, cmp, n2) \
|
||
|
@@ -226,7 +226,7 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
if (PGM_LIKELY(_n1 cmp _n2)); \
|
||
|
else { \
|
||
|
pgm_fatal ("file %s: line %d (%s): assertion failed (%s): (%" PRIi64 " %s %" PRIi64 ")", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
|
||
|
+ __FILE__, __LINE__, __func__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
|
||
|
abort (); \
|
||
|
} \
|
||
|
} while (0)
|
||
|
@@ -236,7 +236,7 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
if (PGM_LIKELY(_n1 cmp _n2)); \
|
||
|
else { \
|
||
|
pgm_fatal ("file %s: line %d (%s): assertion failed (%s): (%" PRIu64 " %s %" PRIu64 ")", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
|
||
|
+ __FILE__, __LINE__, __func__, #n1 " " #cmp " " #n2, _n1, #cmp, _n2); \
|
||
|
abort (); \
|
||
|
} \
|
||
|
} while (0)
|
||
|
@@ -295,7 +295,7 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
if (PGM_LIKELY(expr)); \
|
||
|
else { \
|
||
|
pgm_warn ("file %s: line %d (%s): assertion `%s' failed", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
|
||
|
+ __FILE__, __LINE__, __func__, #expr); \
|
||
|
return; \
|
||
|
} \
|
||
|
} while (0)
|
||
|
@@ -304,20 +304,20 @@ static inline void pgm_fatal (const char* format, ...) {
|
||
|
if (PGM_LIKELY(expr)); \
|
||
|
else { \
|
||
|
pgm_warn ("file %s: line %d (%s): assertion `%s' failed", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \
|
||
|
+ __FILE__, __LINE__, __func__, #expr); \
|
||
|
return (val); \
|
||
|
} \
|
||
|
} while (0)
|
||
|
# define pgm_return_if_reached() \
|
||
|
do { \
|
||
|
pgm_warn ("file %s: line %d (%s): should not be reached", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
||
|
+ __FILE__, __LINE__, __func__); \
|
||
|
return; \
|
||
|
} while (0)
|
||
|
# define pgm_return_val_if_reached(val) \
|
||
|
do { \
|
||
|
pgm_warn ("file %s: line %d (%s): should not be reached", \
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
||
|
+ __FILE__, __LINE__, __func__); \
|
||
|
return (val); \
|
||
|
} while (0)
|
||
|
|
||
|
diff --git a/openpgm/pgm/mem.c b/openpgm/pgm/mem.c
|
||
|
index 5697baf..d3d5295 100644
|
||
|
--- a/openpgm/pgm/mem.c
|
||
|
+++ b/openpgm/pgm/mem.c
|
||
|
@@ -163,7 +163,7 @@ pgm_malloc (
|
||
|
|
||
|
#ifdef __GNUC__
|
||
|
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu " bytes",
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
|
||
|
+ __FILE__, __LINE__, __func__,
|
||
|
n_bytes);
|
||
|
#else
|
||
|
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu " bytes",
|
||
|
@@ -186,7 +186,7 @@ pgm_malloc_n (
|
||
|
if (SIZE_OVERFLOWS (n_blocks, block_bytes)) {
|
||
|
#ifdef __GNUC__
|
||
|
pgm_fatal ("file %s: line %d (%s): overflow allocating %" PRIzu "*%" PRIzu " bytes",
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
|
||
|
+ __FILE__, __LINE__, __func__,
|
||
|
n_blocks, block_bytes);
|
||
|
#else
|
||
|
pgm_fatal ("file %s: line %d: overflow allocating %" PRIzu "*%" PRIzu " bytes",
|
||
|
@@ -210,7 +210,7 @@ pgm_malloc0 (
|
||
|
|
||
|
#ifdef __GNUC__
|
||
|
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu " bytes",
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
|
||
|
+ __FILE__, __LINE__, __func__,
|
||
|
n_bytes);
|
||
|
#else
|
||
|
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu " bytes",
|
||
|
@@ -236,7 +236,7 @@ pgm_malloc0_n (
|
||
|
|
||
|
#ifdef __GNUC__
|
||
|
pgm_fatal ("file %s: line %d (%s): failed to allocate %" PRIzu "*%" PRIzu " bytes",
|
||
|
- __FILE__, __LINE__, __PRETTY_FUNCTION__,
|
||
|
+ __FILE__, __LINE__, __func__,
|
||
|
n_blocks, block_bytes);
|
||
|
#else
|
||
|
pgm_fatal ("file %s: line %d: failed to allocate %" PRIzu "*%" PRIzu " bytes",
|