Commit 876c5fc3f6c6f100d85973eb185d961a2f8f8444

Daniel Mendler 2019-12-05T11:47:36

disable __func__ in c89 compilers

diff --git a/makefile b/makefile
index 1cd5778..b24fe85 100644
--- a/makefile
+++ b/makefile
@@ -172,6 +172,7 @@ c89:
 	-e 's/\(PRI[iux]64\)/MP_\1/g' \
 	-e 's/uint\([0-9][0-9]*\)_t/mp_u\1/g' \
 	-e 's/int\([0-9][0-9]*\)_t/mp_i\1/g' \
+	-e 's/__func__/MP_FUNCTION_NAME/g' \
 	*.c tommath.h tommath_private.h demo/*.c demo/*.h etc/*.c
 
 c99:
@@ -194,6 +195,7 @@ c99:
 	-e 's/MP_\(PRI[iux]64\)/\1/g' \
 	-e 's/mp_u\([0-9][0-9]*\)/uint\1_t/g' \
 	-e 's/mp_i\([0-9][0-9]*\)/int\1_t/g' \
+	-e 's/MP_FUNCTION_NAME/__func__/g' \
 	*.c tommath.h tommath_private.h demo/*.c demo/*.h etc/*.c
 
 astyle:
diff --git a/tommath_c89.h b/tommath_c89.h
index 35fb828..e7b87f1 100644
--- a/tommath_c89.h
+++ b/tommath_c89.h
@@ -36,3 +36,5 @@ typedef __UINT64_TYPE__ mp_u64;
 #define MP_PRIi64 MP_PRI64_PREFIX "i"
 #define MP_PRIu64 MP_PRI64_PREFIX "u"
 #define MP_PRIx64 MP_PRI64_PREFIX "x"
+
+#define MP_FUNCTION_NAME __func__