diff options
author | Anders F Björklund <anders.f.bjorklund@gmail.com> | 2018-09-16 18:31:20 +0200 |
---|---|---|
committer | Anders F Björklund <anders.f.bjorklund@gmail.com> | 2018-09-16 18:31:20 +0200 |
commit | 79a85ebb17ceddef5b5f093549681506abf524c2 (patch) | |
tree | 6b95b9cf7ab54ac0dbc964b82be0a9978818c4e1 | |
parent | 5922ffcfa75a18e78c4ae75bb447b34a0d91d12b (diff) | |
download | ccache-79a85ebb17ceddef5b5f093549681506abf524c2.tar.gz |
Don't use reserved id macros in the headers
With an exception for the generated config.h
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | src/hashtable.h | 6 | ||||
-rw-r--r-- | src/hashtable_itr.h | 6 | ||||
-rw-r--r-- | src/hashtable_private.h | 6 |
4 files changed, 21 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 50211d85..af0e6323 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/hashtable.h b/src/hashtable.h index 42800075..91fb387d 100644 --- a/src/hashtable.h +++ b/src/hashtable.h @@ -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 diff --git a/src/hashtable_itr.h b/src/hashtable_itr.h index 9523b14a..a0ac22cb 100644 --- a/src/hashtable_itr.h +++ b/src/hashtable_itr.h @@ -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 diff --git a/src/hashtable_private.h b/src/hashtable_private.h index a81afca8..5d765d62 100644 --- a/src/hashtable_private.h +++ b/src/hashtable_private.h @@ -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 |