summaryrefslogtreecommitdiff
path: root/gphoto2
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 /gphoto2
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 'gphoto2')
-rw-r--r--gphoto2/gphoto2-abilities-list.h6
-rw-r--r--gphoto2/gphoto2-camera.h6
-rw-r--r--gphoto2/gphoto2-context.h6
-rw-r--r--gphoto2/gphoto2-file.h6
-rw-r--r--gphoto2/gphoto2-filesys.h6
-rw-r--r--gphoto2/gphoto2-library.h6
-rw-r--r--gphoto2/gphoto2-list.h6
-rw-r--r--gphoto2/gphoto2-result.h6
-rw-r--r--gphoto2/gphoto2-setting.h6
-rw-r--r--gphoto2/gphoto2-version.h7
-rw-r--r--gphoto2/gphoto2-widget.h6
-rw-r--r--gphoto2/gphoto2.h7
12 files changed, 38 insertions, 36 deletions
diff --git a/gphoto2/gphoto2-abilities-list.h b/gphoto2/gphoto2-abilities-list.h
index 58eb3d033..00998ca68 100644
--- a/gphoto2/gphoto2-abilities-list.h
+++ b/gphoto2/gphoto2-abilities-list.h
@@ -22,8 +22,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_ABILITIES_LIST_H__
-#define __GPHOTO2_ABILITIES_LIST_H__
+#ifndef LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H
+#define LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H
#include <gphoto2/gphoto2-context.h>
#include <gphoto2/gphoto2-list.h>
@@ -203,4 +203,4 @@ const char *gp_message_codeset (const char *);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_ABILITIES_LIST_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H) */
diff --git a/gphoto2/gphoto2-camera.h b/gphoto2/gphoto2-camera.h
index f9ee30911..445c839fa 100644
--- a/gphoto2/gphoto2-camera.h
+++ b/gphoto2/gphoto2-camera.h
@@ -23,8 +23,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_CAMERA_H__
-#define __GPHOTO2_CAMERA_H__
+#ifndef LIBGPHOTO2_GPHOTO2_CAMERA_H
+#define LIBGPHOTO2_GPHOTO2_CAMERA_H
#ifdef __cplusplus
extern "C" {
@@ -481,4 +481,4 @@ void gp_camera_stop_timeout (Camera *camera, unsigned int id);
#endif /* __cplusplus */
-#endif /* __GPHOTO2_CAMERA_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_CAMERA_H) */
diff --git a/gphoto2/gphoto2-context.h b/gphoto2/gphoto2-context.h
index 3a3d13098..f8b67c9c0 100644
--- a/gphoto2/gphoto2-context.h
+++ b/gphoto2/gphoto2-context.h
@@ -22,8 +22,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_CONTEXT_H__
-#define __GPHOTO2_CONTEXT_H__
+#ifndef LIBGPHOTO2_GPHOTO2_CONTEXT_H
+#define LIBGPHOTO2_GPHOTO2_CONTEXT_H
#include <stdarg.h>
@@ -135,4 +135,4 @@ void gp_context_progress_stop (GPContext *context, unsigned int id);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_CONTEXT_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_CONTEXT_H) */
diff --git a/gphoto2/gphoto2-file.h b/gphoto2/gphoto2-file.h
index 5cf19c77a..53c9eab86 100644
--- a/gphoto2/gphoto2-file.h
+++ b/gphoto2/gphoto2-file.h
@@ -23,8 +23,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_FILE_H__
-#define __GPHOTO2_FILE_H__
+#ifndef LIBGPHOTO2_GPHOTO2_FILE_H
+#define LIBGPHOTO2_GPHOTO2_FILE_H
#include <time.h>
#include <stdint.h>
@@ -174,4 +174,4 @@ int gp_file_slurp (CameraFile*, char *data,
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_FILE_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_FILE_H) */
diff --git a/gphoto2/gphoto2-filesys.h b/gphoto2/gphoto2-filesys.h
index d8bceaf12..eb417f640 100644
--- a/gphoto2/gphoto2-filesys.h
+++ b/gphoto2/gphoto2-filesys.h
@@ -27,8 +27,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_FILESYS_H__
-#define __GPHOTO2_FILESYS_H__
+#ifndef LIBGPHOTO2_GPHOTO2_FILESYS_H
+#define LIBGPHOTO2_GPHOTO2_FILESYS_H
#include <time.h>
#include <stdint.h>
@@ -381,4 +381,4 @@ int gp_filesystem_dump (CameraFilesystem *fs);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_FILESYS_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_FILESYS_H) */
diff --git a/gphoto2/gphoto2-library.h b/gphoto2/gphoto2-library.h
index b0f8c530f..3c93fbbdb 100644
--- a/gphoto2/gphoto2-library.h
+++ b/gphoto2/gphoto2-library.h
@@ -22,8 +22,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_LIBRARY_H__
-#define __GPHOTO2_LIBRARY_H__
+#ifndef LIBGPHOTO2_GPHOTO2_LIBRARY_H
+#define LIBGPHOTO2_GPHOTO2_LIBRARY_H
#include <gphoto2/gphoto2-abilities-list.h>
#include <gphoto2/gphoto2-camera.h>
@@ -77,4 +77,4 @@ int camera_init (Camera *camera, GPContext *context);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_LIBRARY_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_LIBRARY_H) */
diff --git a/gphoto2/gphoto2-list.h b/gphoto2/gphoto2-list.h
index 70944d7ef..f47e02f23 100644
--- a/gphoto2/gphoto2-list.h
+++ b/gphoto2/gphoto2-list.h
@@ -23,8 +23,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_LIST_H__
-#define __GPHOTO2_LIST_H__
+#ifndef LIBGPHOTO2_GPHOTO2_LIST_H
+#define LIBGPHOTO2_GPHOTO2_LIST_H
#ifdef __cplusplus
extern "C" {
@@ -90,4 +90,4 @@ int gp_list_populate (CameraList *list, const char *format, int count);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_LIST_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_LIST_H) */
diff --git a/gphoto2/gphoto2-result.h b/gphoto2/gphoto2-result.h
index 87b8b4c7c..0a669770f 100644
--- a/gphoto2/gphoto2-result.h
+++ b/gphoto2/gphoto2-result.h
@@ -21,8 +21,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_RESULT_H__
-#define __GPHOTO2_RESULT_H__
+#ifndef LIBGPHOTO2_GPHOTO2_RESULT_H
+#define LIBGPHOTO2_GPHOTO2_RESULT_H
/* Additional error codes are defined here */
#include <gphoto2/gphoto2-port-result.h>
@@ -138,4 +138,4 @@ const char *gp_result_as_string (int result);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_RESULT_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_RESULT_H) */
diff --git a/gphoto2/gphoto2-setting.h b/gphoto2/gphoto2-setting.h
index 697cea91e..34c6d8942 100644
--- a/gphoto2/gphoto2-setting.h
+++ b/gphoto2/gphoto2-setting.h
@@ -21,8 +21,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_SETTING_H__
-#define __GPHOTO2_SETTING_H__
+#ifndef LIBGPHOTO2_GPHOTO2_SETTING_H
+#define LIBGPHOTO2_GPHOTO2_SETTING_H
#ifdef __cplusplus
extern "C" {
@@ -35,4 +35,4 @@ int gp_setting_get (char *id, char *key, char *value);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_SETTING_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_SETTING_H) */
diff --git a/gphoto2/gphoto2-version.h b/gphoto2/gphoto2-version.h
index a25fc094a..f13f0a935 100644
--- a/gphoto2/gphoto2-version.h
+++ b/gphoto2/gphoto2-version.h
@@ -20,8 +20,9 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_VERSION_H__
-#define __GPHOTO2_VERSION_H__
+
+#ifndef LIBGPHOTO2_GPHOTO2_VERSION_H
+#define LIBGPHOTO2_GPHOTO2_VERSION_H
#include <gphoto2/gphoto2-port-version.h>
@@ -35,4 +36,4 @@ const char **gp_library_version(GPVersionVerbosity verbose);
}
#endif
-#endif /* __GPHOTO2_VERSION_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_VERSION_H) */
diff --git a/gphoto2/gphoto2-widget.h b/gphoto2/gphoto2-widget.h
index d33437cbb..9b2005929 100644
--- a/gphoto2/gphoto2-widget.h
+++ b/gphoto2/gphoto2-widget.h
@@ -21,8 +21,8 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_WIDGET_H__
-#define __GPHOTO2_WIDGET_H__
+#ifndef LIBGPHOTO2_GPHOTO2_WIDGET_H
+#define LIBGPHOTO2_GPHOTO2_WIDGET_H
#include <gphoto2/gphoto2-context.h>
@@ -130,4 +130,4 @@ int gp_widget_get_readonly (CameraWidget *widget, int *readonly);
}
#endif /* __cplusplus */
-#endif /* __GPHOTO2_WIDGET_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_WIDGET_H) */
diff --git a/gphoto2/gphoto2.h b/gphoto2/gphoto2.h
index b73bdbb84..600096829 100644
--- a/gphoto2/gphoto2.h
+++ b/gphoto2/gphoto2.h
@@ -21,8 +21,9 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
-#ifndef __GPHOTO2_H__
-#define __GPHOTO2_H__
+
+#ifndef LIBGPHOTO2_GPHOTO2_H
+#define LIBGPHOTO2_GPHOTO2_H
#ifdef __cplusplus
extern "C" {
@@ -46,4 +47,4 @@ extern "C" {
}
#endif
-#endif /* __GPHOTO2_H__ */
+#endif /* !defined(LIBGPHOTO2_GPHOTO2_H) */