]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't use reserved id macros in the headers
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:31:20 +0000 (18:31 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 16:31:20 +0000 (18:31 +0200)
With an exception for the generated config.h

configure.ac
src/hashtable.h
src/hashtable_itr.h
src/hashtable_private.h

index 50211d85a69d92ac717cb1afeeb52fcf81d91f70..af0e6323cb66eceb9bc50a99e14b8de6285cb848 100644 (file)
@@ -195,9 +195,20 @@ AC_OUTPUT
 cat <<EOF >config.h.tmp
 #ifndef CCACHE_CONFIG_H
 #define CCACHE_CONFIG_H
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreserved-id-macro"
+#endif
+
 EOF
 cat config.h >>config.h.tmp
-echo '#endif' >>config.h.tmp
+cat <<EOF >>config.h.tmp
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+#endif // ifndef CCACHE_CONFIG_H
+EOF
 mv config.h.tmp config.h
 
 AC_MSG_NOTICE(now build ccache by running make)
index 428000752f7e22612e60f785b9afcac5e2b4d3f7..91fb387d8e8519ee0feee322bfee541c22053a94 100644 (file)
@@ -29,8 +29,8 @@
   POSSIBILITY OF SUCH DAMAGE.
 */
 
-#ifndef __HASHTABLE_CWC22_H__
-#define __HASHTABLE_CWC22_H__
+#ifndef HASHTABLE_CWC22_H
+#define HASHTABLE_CWC22_H
 
 #include "config.h"
 
@@ -194,7 +194,7 @@ hashtable_count(struct hashtable *h);
 void
 hashtable_destroy(struct hashtable *h, int free_values);
 
-#endif /* __HASHTABLE_CWC22_H__ */
+#endif /* HASHTABLE_CWC22_H */
 
 /*
  * Copyright (c) 2002, Christopher Clark
index 9523b14a4b6bdf7801a0cba8b88955b701f58fd9..a0ac22cbca151c00de16e6ba1ba579894bf1d3c5 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
 
-#ifndef __HASHTABLE_ITR_CWC22__
-#define __HASHTABLE_ITR_CWC22__
+#ifndef HASHTABLE_ITR_CWC22_H
+#define HASHTABLE_ITR_CWC22_H
 #include "hashtable.h"
 #include "hashtable_private.h" /* needed to enable inlining */
 
@@ -86,7 +86,7 @@ int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
 
 
 
-#endif /* __HASHTABLE_ITR_CWC22__*/
+#endif /* HASHTABLE_ITR_CWC22_H */
 
 /*
  * Copyright (c) 2002, 2004, Christopher Clark
index a81afca8843485fedaf72c40b39f9133bae9ea30..5d765d62d380a78125ca1d0ec641410b16672695 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
 
-#ifndef __HASHTABLE_PRIVATE_CWC22_H__
-#define __HASHTABLE_PRIVATE_CWC22_H__
+#ifndef HASHTABLE_PRIVATE_CWC22_H
+#define HASHTABLE_PRIVATE_CWC22_H
 
 #include "hashtable.h"
 
@@ -49,7 +49,7 @@ indexFor(unsigned int tablelength, unsigned int hashvalue)
 
 /*****************************************************************************/
 
-#endif /* __HASHTABLE_PRIVATE_CWC22_H__*/
+#endif /* HASHTABLE_PRIVATE_CWC22_H */
 
 /*
  * Copyright (c) 2002, Christopher Clark