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. --- libgphoto2_port/vusb/vcamera.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libgphoto2_port/vusb') diff --git a/libgphoto2_port/vusb/vcamera.h b/libgphoto2_port/vusb/vcamera.h index db8426fd6..e15a27f61 100644 --- a/libgphoto2_port/vusb/vcamera.h +++ b/libgphoto2_port/vusb/vcamera.h @@ -19,8 +19,8 @@ * Boston, MA 02110-1301 USA */ -#ifndef __VCAMERA_H__ -#define __VCAMERA_H__ +#ifndef IOLIBS_VUSB_VCAMERA_H +#define IOLIBS_VUSB_VCAMERA_H #undef FUZZ_PTP @@ -76,4 +76,4 @@ typedef struct vcamera { vcamera *vcamera_new(vcameratype); -#endif +#endif /* !defined(IOLIBS_VUSB_VCAMERA_H) */ -- cgit v1.2.1