From 4a1e84b721eadc73e880698dbc0427be7f4acfbe Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 3 Sep 2018 13:30:11 -0600 Subject: [PATCH] Re github issue https://github.com/Unidata/netcdf-c/issues/1131 The identifier typename is apparently a reserved word in C++. It is used as a fieldname in the ALignment struct in include/ncoffsets.h. Change the field name to type_name in ncoffsets.h and also in libdispatch/doffsets.c, which uses that field. --- include/ncoffsets.h | 2 +- libdispatch/doffsets.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/ncoffsets.h b/include/ncoffsets.h index ca107969c..87dfd550b 100644 --- a/include/ncoffsets.h +++ b/include/ncoffsets.h @@ -7,7 +7,7 @@ #define NCOFFSETS_H 1 typedef struct Alignment { - char* typename; + char* type_name; unsigned int alignment; } Alignment; diff --git a/libdispatch/doffsets.c b/libdispatch/doffsets.c index 996b3c6fd..4d6078f02 100644 --- a/libdispatch/doffsets.c +++ b/libdispatch/doffsets.c @@ -87,7 +87,7 @@ all compilers seem to mimic the gcc rules. #define COMP_ALIGNMENT(DST,TYPE) {\ struct {char f1; TYPE x;} tmp; \ - DST.typename = #TYPE ; \ + DST.type_name = #TYPE ; \ DST.alignment = (size_t)((char*)(&(tmp.x)) - (char*)(&tmp));} #if 0 @@ -186,7 +186,7 @@ compute_alignments(void) */ #define COMP_ALIGNMENT1(DST,TYPE1,TYPE) {\ struct {TYPE1 f1; TYPE x;} tmp; \ - DST.typename = #TYPE ; \ + DST.type_name = #TYPE ; \ DST.alignment = (size_t)((char*)(&(tmp.x)) - (char*)(&tmp));} /* Compute the alignment of TYPE when it is preceded @@ -194,7 +194,7 @@ compute_alignments(void) */ #define COMP_ALIGNMENT2(DST,TYPE1,TYPE2,TYPE) {\ struct {TYPE1 f1, TYPE2 f2; TYPE x;} tmp; \ - DST.typename = #TYPE ; \ + DST.type_name = #TYPE ; \ DST.alignment = (size_t)((char*)(&(tmp.x)) - (char*)(&tmp));} /* Compute the alignment of TYPE when it is preceded @@ -301,15 +301,15 @@ verify(Typealignvec* vec) for(i=0;i