[PPL-devel] [GIT] ppl/ppl(devel): Avoid using reserved identifiers.

Roberto Bagnara roberto.bagnara at bugseng.com
Sat Aug 8 20:55:16 CEST 2020


Module: ppl/ppl
Branch: devel
Commit: c42972fa56cd3edc781fb785c4f13f5dd3346422
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=c42972fa56cd3edc781fb785c4f13f5dd3346422

Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date:   Sat Aug  8 20:55:00 2020 +0200

Avoid using reserved identifiers.

---

 configure.ac                | 11 +----------
 demos/ppl_lpsol/ppl_lpsol.c |  8 ++++----
 ppl-config.sed              |  6 +++---
 tests/ppl_test.hh           |  8 ++++----
 4 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index a0e7e2ef0..5c17a0c24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,16 +106,7 @@ AH_BOTTOM([
 # define NDEBUG PPL_NDEBUG
 #endif
 
-/* In order for the definition of `int64_t' to be seen by Comeau C/C++,
-   we must make sure <stdint.h> is included before <sys/types.hh> is
-   (even indirectly) included.  Moreover we need to define
-   __STDC_LIMIT_MACROS before the first inclusion of <stdint.h>
-   in order to have the macros defined also in C++.  */
-
 #ifdef PPL_HAVE_STDINT_H
-# ifndef __STDC_LIMIT_MACROS
-#  define __STDC_LIMIT_MACROS 1
-# endif
 # include <stdint.h>
 #endif
 
@@ -1561,7 +1552,7 @@ then
 #endif
                 ])
   AC_CHECK_FUNC(_glp_lib_print_hook,
-                AC_DEFINE(PPL_GLPK_HAS__GLP_LIB_PRINT_HOOK,
+                AC_DEFINE(PPL_GLPK_HAS_GLP_LIB_PRINT_HOOK,
                           1,
                           [Defined if GLPK provides _glp_lib_print_hook().]))
   AC_CHECK_DECL(glp_term_out,
diff --git a/demos/ppl_lpsol/ppl_lpsol.c b/demos/ppl_lpsol/ppl_lpsol.c
index 9bbfebf3c..9f2deba7f 100644
--- a/demos/ppl_lpsol/ppl_lpsol.c
+++ b/demos/ppl_lpsol/ppl_lpsol.c
@@ -1273,7 +1273,7 @@ error_handler(enum ppl_enum_error_code code,
 #if !(defined(PPL_GLPK_HAS_GLP_TERM_OUT) && defined(GLP_OFF))
 
 #if defined(PPL_GLPK_HAS_GLP_TERM_HOOK) \
-  || defined(PPL_GLPK_HAS__GLP_LIB_PRINT_HOOK)
+  || defined(PPL_GLPK_HAS_GLP_LIB_PRINT_HOOK)
 
 static int
 glpk_message_interceptor(void* info, const char* msg) {
@@ -1292,7 +1292,7 @@ glpk_message_interceptor(void* info, char* msg) {
 }
 
 #endif /* !(defined(PPL_GLPK_HAS_GLP_TERM_HOOK)
-            || defined(PPL_GLPK_HAS__GLP_LIB_PRINT_HOOK))
+            || defined(PPL_GLPK_HAS_GLP_LIB_PRINT_HOOK))
           && defined(PPL_GLPK_HAS_LIB_SET_PRINT_HOOK) */
 
 #endif /* !(defined(PPL_GLPK_HAS_GLP_TERM_OUT) && defined(GLP_OFF)) */
@@ -1598,7 +1598,7 @@ main(int argc, char* argv[]) {
   struct timeval master_thread_time;
 #endif
 
-#if defined(PPL_GLPK_HAS__GLP_LIB_PRINT_HOOK)
+#if defined(PPL_GLPK_HAS_GLP_LIB_PRINT_HOOK)
   extern void _glp_lib_print_hook(int (*func)(void *info, const char *buf),
                                   void *info);
 #endif
@@ -1626,7 +1626,7 @@ main(int argc, char* argv[]) {
   glp_term_out(GLP_OFF);
 #elif defined(PPL_GLPK_HAS_GLP_TERM_HOOK)
   glp_term_hook(glpk_message_interceptor, 0);
-#elif defined(PPL_GLPK_HAS__GLP_LIB_PRINT_HOOK)
+#elif defined(PPL_GLPK_HAS_GLP_LIB_PRINT_HOOK)
   _glp_lib_print_hook(glpk_message_interceptor, 0);
 #elif defined(PPL_GLPK_HAS_LIB_SET_PRINT_HOOK)
   lib_set_print_hook(0, glpk_message_interceptor);
diff --git a/ppl-config.sed b/ppl-config.sed
index dd94ee3f0..a37109046 100644
--- a/ppl-config.sed
+++ b/ppl-config.sed
@@ -48,9 +48,9 @@ s/\([^A-Z_]\)HAVE_UINT_FAST32_T/\1PPL_HAVE_UINT_FAST32_T/g
 s/\([^A-Z_]\)HAVE_UINT_FAST64_T/\1PPL_HAVE_UINT_FAST64_T/g
 s/\([^A-Z_]\)HAVE_UINTPTR_T/\1PPL_HAVE_UINTPTR_T/g
 s/\([^A-Z_]\)HAVE_UNISTD_H/\1PPL_HAVE_UNISTD_H/g
-s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_ALLOC/\1PPL_HAVE___MPZ_STRUCT__MP_ALLOC/g
-s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_D/\1PPL_HAVE___MPZ_STRUCT__MP_D/g
-s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_SIZE/\1PPL_HAVE___MPZ_STRUCT__MP_SIZE/g
+s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_ALLOC/\1PPL_HAVE_MPZ_STRUCT_MP_ALLOC/g
+s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_D/\1PPL_HAVE_MPZ_STRUCT_MP_D/g
+s/\([^A-Z_]\)HAVE___MPZ_STRUCT__MP_SIZE/\1PPL_HAVE_MPZ_STRUCT_MP_SIZE/g
 s/\([^A-Z_]\)PACKAGE_BUGREPORT/\1PPL_PACKAGE_BUGREPORT/g
 s/\([^A-Z_]\)PACKAGE_NAME/\1PPL_PACKAGE_NAME/g
 s/\([^A-Z_]\)PACKAGE_STRING/\1PPL_PACKAGE_STRING/g
diff --git a/tests/ppl_test.hh b/tests/ppl_test.hh
index fbee295cf..67789f2f7 100644
--- a/tests/ppl_test.hh
+++ b/tests/ppl_test.hh
@@ -201,15 +201,15 @@ catch (const std::exception& e) {                                       \
 #define PPL_CPP_IS_NEGx_arg_neg 0)(0
 #define PPL_CPP_IS_NEGx(v) PPL_CPP_VAL_a(PPL_CPP_IS_NEGx_arg_##v)
 
-#define PPL_CPP_IS_NEG__(v) v ## _
-#define PPL_CPP_IS_NEG_(v) PPL_CPP_IS_NEG__(v)
+#define PPL_CPP_IS_NEG_p(v) v ## _
+#define PPL_CPP_IS_NEG_(v) PPL_CPP_IS_NEG_p(v)
 #define PPL_CPP_IS_NEG(v) PPL_CPP_IS_NEG_(PPL_CPP_IS_NEGx(v))
 
 #define PPL_CPP_IS_ZEROx_arg_0 0)(0
 #define PPL_CPP_IS_ZEROx(v) PPL_CPP_VAL_a(PPL_CPP_IS_ZEROx_arg_##v)
 
-#define PPL_CPP_IS_ZERO__(v) v ## _
-#define PPL_CPP_IS_ZERO_(v) PPL_CPP_IS_ZERO__(v)
+#define PPL_CPP_IS_ZERO_p(v) v ## _
+#define PPL_CPP_IS_ZERO_(v) PPL_CPP_IS_ZERO_p(v)
 #define PPL_CPP_IS_ZERO(v) PPL_CPP_IS_ZERO_(PPL_CPP_IS_ZEROx(v))
 
 #define PPL_CPP_DECR_neg neg




More information about the PPL-devel mailing list