diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-10-05 15:50:32 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-10-05 16:07:20 +0200 |
commit | 0dbeaf7cbf30ab88ac7aea3e7d3f24df8dc0309f (patch) | |
tree | 5473eb1125e904a86e479180689167280a2e81dc /camlibs/ptp2/chdk_ptp.h | |
parent | bacd4128617e1dd613998c0268ded8304cef6f19 (diff) | |
download | libgphoto2-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/ptp2/chdk_ptp.h')
-rw-r--r-- | camlibs/ptp2/chdk_ptp.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/camlibs/ptp2/chdk_ptp.h b/camlibs/ptp2/chdk_ptp.h index 8adbd2717..5c8d60923 100644 --- a/camlibs/ptp2/chdk_ptp.h +++ b/camlibs/ptp2/chdk_ptp.h @@ -1,5 +1,5 @@ -#ifndef __CHDK_PTP_H -#define __CHDK_PTP_H +#ifndef CAMLIBS_PTP2_CHDK_PTP_H +#define CAMLIBS_PTP2_CHDK_PTP_H // CHDK PTP protocol interface (can also be used in client PTP programs) @@ -627,4 +627,4 @@ enum ptp_chdk_script_msg_status { PTP_CHDK_S_MSGSTATUS_BADID, // specified ID is not running }; -#endif // __CHDK_PTP_H +#endif /* !defined(CAMLIBS_PTP2_CHDK_PTP_H) */ |