Browse Source

Fixed __COUNTER__ macro for PowerPC compilation

A "dirty" fix to allow GCC 4.2.2 compilation by aliasing `__COUNTER__` with `__LINE__`.
Root-Core 6 years ago
parent
commit
961f0dbde8
1 changed files with 3 additions and 0 deletions
  1. 3 0
      include/ua_config.h.in

+ 3 - 0
include/ua_config.h.in

@@ -93,6 +93,9 @@ extern "C" {
 #elif defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) /* GCC, Clang, MSC */
 #elif defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) /* GCC, Clang, MSC */
 # define UA_CTASTR2(pre,post) pre ## post
 # define UA_CTASTR2(pre,post) pre ## post
 # define UA_CTASTR(pre,post) UA_CTASTR2(pre,post)
 # define UA_CTASTR(pre,post) UA_CTASTR2(pre,post)
+# ifndef __COUNTER__ /* PPC GCC fix */
+#  define __COUNTER__ __LINE__
+# endif
 # define UA_STATIC_ASSERT(cond,msg)                             \
 # define UA_STATIC_ASSERT(cond,msg)                             \
     typedef struct {                                            \
     typedef struct {                                            \
         int UA_CTASTR(static_assertion_failed_,msg) : !!(cond); \
         int UA_CTASTR(static_assertion_failed_,msg) : !!(cond); \