summaryrefslogtreecommitdiff
path: root/camlibs/jd11
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-05 15:50:32 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2021-10-05 16:07:20 +0200
commit0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f (patch)
tree5473eb1125e904a86e479180689167280a2e81dc /camlibs/jd11
parentbacd4128617e1dd613998c0268ded8304cef6f19 (diff)
downloadlibgphoto2-0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f.tar.gz
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.
Diffstat (limited to 'camlibs/jd11')
-rw-r--r--camlibs/jd11/decomp.h8
-rw-r--r--camlibs/jd11/serial.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/camlibs/jd11/decomp.h b/camlibs/jd11/decomp.h
index 819ca025e..0a843a196 100644
--- a/camlibs/jd11/decomp.h
+++ b/camlibs/jd11/decomp.h
@@ -18,8 +18,10 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef _JD11_DECOMP_H
-#define _JD11_DECOMP_H
+#ifndef CAMLIBS_JD11_DECOMP_H
+#define CAMLIBS_JD11_DECOMP_H
+
extern void picture_decomp_v1(unsigned char *compressed,unsigned char *uncompressed,int width,int height);
extern void picture_decomp_v2(unsigned char *compressed,unsigned char *uncompressed,int width,int height);
-#endif
+
+#endif /* !defined(CAMLIBS_JD11_DECOMP_H) */
diff --git a/camlibs/jd11/serial.h b/camlibs/jd11/serial.h
index 588a87a56..c2247029a 100644
--- a/camlibs/jd11/serial.h
+++ b/camlibs/jd11/serial.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef _JD11_SERIAL_H
-#define _JD11_SERIAL_H
+#ifndef CAMLIBS_JD11_SERIAL_H
+#define CAMLIBS_JD11_SERIAL_H
#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port.h>
@@ -39,4 +39,4 @@ extern int jd11_get_rgb(GPPort *port, float *red, float *green, float *blue);
#define IMGHEADER "P6\n# gPhoto2 JD11 thumbnail image\n640 480 255\n"
#define THUMBHEADER "P5\n# gPhoto2 JD11 thumbnail image\n64 48 255\n"
-#endif
+#endif /* !defined(CAMLIBS_JD11_SERIAL_H) */