aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-09-04 14:56:49 +0200
committerSverker Eriksson <[email protected]>2013-09-30 17:45:45 +0200
commite0e17136506f9c8363b46a991012422980925dd1 (patch)
tree1e444d163e87e47839761116b7ecaf607cadd0b4 /erts
parent984f0e42665e9fa09467145976183bf88f8f3da8 (diff)
downloadotp-e0e17136506f9c8363b46a991012422980925dd1.tar.gz
otp-e0e17136506f9c8363b46a991012422980925dd1.tar.bz2
otp-e0e17136506f9c8363b46a991012422980925dd1.zip
erts: Add __func__ to ERTS_ASSERT macro
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/sys.h4
-rw-r--r--erts/emulator/sys/common/erl_mmap.c13
-rw-r--r--erts/emulator/sys/unix/sys.c6
-rwxr-xr-xerts/emulator/sys/win32/sys.c2
4 files changed, 7 insertions, 18 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index dfe60d8ea0..9561c0be96 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -150,8 +150,8 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType;
#endif
#define ERTS_ASSERT(e) \
- ((void) ((e) ? 1 : (erl_assert_error(#e, __FILE__, __LINE__), 0)))
-void erl_assert_error(char* expr, char* file, int line);
+ ((void) ((e) ? 1 : (erl_assert_error(#e, __func__, __FILE__, __LINE__), 0)))
+void erl_assert_error(const char* expr, const char *func, const char* file, int line);
#ifdef DEBUG
# define ASSERT(e) ERTS_ASSERT(e)
diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c
index ede7c66fdc..58795bd3a6 100644
--- a/erts/emulator/sys/common/erl_mmap.c
+++ b/erts/emulator/sys/common/erl_mmap.c
@@ -34,18 +34,7 @@
/* #define ERTS_MMAP_DEBUG_FILL_AREAS */
#ifdef ERTS_MMAP_DEBUG
-# define ERTS_MMAP_ASSERT(A) \
- ((void) (!(A) \
- ? erts_mmap_assert_failed(#A, __func__, __FILE__, __LINE__)\
- : 1))
-static int
-erts_mmap_assert_failed(const char *a, const char *func, const char *file, int line)
-{
- erts_fprintf(stderr, "%s:%d:%s() Assertion failed: %s\n",
- (char *) file, line, (char *) func, (char *) a);
- abort();
- return 0;
-}
+# define ERTS_MMAP_ASSERT ERTS_ASSERT
#else
# define ERTS_MMAP_ASSERT(A) ((void) 1)
#endif
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 47991756df..401b37b9d2 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -2640,11 +2640,11 @@ int fd;
extern int erts_initialized;
void
-erl_assert_error(char* expr, char* file, int line)
+erl_assert_error(const char* expr, const char* func, const char* file, int line)
{
fflush(stdout);
- fprintf(stderr, "Assertion failed: %s in %s, line %d\n",
- expr, file, line);
+ fprintf(stderr, "%s:%d:%s() Assertion failed: %s\n",
+ file, line, func, expr);
fflush(stderr);
#if !defined(ERTS_SMP) && 0
/* Writing a crashdump from a failed assertion when smp support
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index 6a1d6b08f4..99951bb45e 100755
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -3224,7 +3224,7 @@ erl_bin_write(buf, sz, max)
}
void
-erl_assert_error(char* expr, char* file, int line)
+erl_assert_error(const char* expr, const char* func, const char* file, int line)
{
char message[1024];