From 0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Tue, 5 Oct 2021 15:50:32 +0200 Subject: Use consistently named non-reserved CPP macros for header files C preprocessor macros beginning/ending with underscores are reserved for system use as well as macros containing a double underscore anywhere, so application software macros are supposed to be named differently. For a header file gphoto2-abilities-list.h, this consistently uses a macro name LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H for the usual #ifndef LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H #define LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H ... content of the header file ... #endif /* !defined(LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H) */ Found using "clang -Weverything". This should work, unless when run with an ancient C preprocessor which might only the first 8 or 10 characters to distinguish macro names and ignores the remainder of the name. --- camlibs/docupen/docupen.h | 5 +++++ camlibs/docupen/huffman.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'camlibs/docupen') diff --git a/camlibs/docupen/docupen.h b/camlibs/docupen/docupen.h index ac45ea9ad..3b9c44603 100644 --- a/camlibs/docupen/docupen.h +++ b/camlibs/docupen/docupen.h @@ -1,3 +1,6 @@ +#ifndef CAMLIBS_DOCUPEN_DOCUPEN_H +#define CAMLIBS_DOCUPEN_DOCUPEN_H + #include #include #include @@ -89,3 +92,5 @@ bool dp_init_calibration(Camera *camera, bool force); gdImagePtr dp_get_image_mono(struct dp_imagehdr *dp, void *data); gdImagePtr dp_get_image_grey(struct dp_imagehdr *dp, void *data, struct lut *lut); gdImagePtr dp_get_image_color(struct dp_imagehdr *dp, void *data, struct lut *lut); + +#endif /* !defined(CAMLIBS_DOCUPEN_DOCUPEN_H) */ diff --git a/camlibs/docupen/huffman.h b/camlibs/docupen/huffman.h index e010e2bf4..35603a641 100644 --- a/camlibs/docupen/huffman.h +++ b/camlibs/docupen/huffman.h @@ -1,3 +1,6 @@ +#ifndef CAMLIBS_DOCUPEN_HUFFMAN_H +#define CAMLIBS_DOCUPEN_HUFFMAN_H + struct decoder { unsigned char *data; int length; @@ -21,3 +24,5 @@ enum { DECODER_WHITE, DECODER_EOL }; + +#endif /* !defined(CAMLIBS_DOCUPEN_HUFFMAN_H) */ -- cgit v1.2.1