summaryrefslogtreecommitdiff
path: root/libgphoto2_port/gphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-07-20 18:10:40 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-07-20 18:10:40 +0000
commitf1842908646e538f6514a9f656f704b975cedac4 (patch)
treea8250d5ff978f0e3d3a1a703bbab25178e53bb47 /libgphoto2_port/gphoto2
parent6117f91dac84ba061269458cb48dff9a9104a42a (diff)
downloadlibgphoto2-f1842908646e538f6514a9f656f704b975cedac4.tar.gz
moved the new GP_ debug helper macros into the
internal part of the header file. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15087 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/gphoto2')
-rw-r--r--libgphoto2_port/gphoto2/gphoto2-port-log.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/libgphoto2_port/gphoto2/gphoto2-port-log.h b/libgphoto2_port/gphoto2/gphoto2-port-log.h
index 070e30a87..f8a69a036 100644
--- a/libgphoto2_port/gphoto2/gphoto2-port-log.h
+++ b/libgphoto2_port/gphoto2/gphoto2-port-log.h
@@ -88,15 +88,6 @@ void gp_logv (GPLogLevel level, const char *domain, const char *format,
void gp_log_data (const char *domain, const char *data, unsigned int size);
/*
- * GP_LOG_D/E:
- * simple helper macros for convenient and consistent logging of error
- * and debug messages including information about the source location.
- */
-#define GP_LOG_D(...) gp_log(GP_LOG_DEBUG, __func__, __VA_ARGS__)
-#define GP_LOG_E(...) gp_log_with_source_location(GP_LOG_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__)
-#define GP_LOG_DATA(DATA, SIZE) gp_log_data(__func__, DATA, SIZE)
-
-/*
* GP_DEBUG:
* msg: message to log
* params: params to message
@@ -114,11 +105,23 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
#elif defined(__GNUC__) && __GNUC__ >= 2
#define GP_DEBUG(msg, params...) \
gp_log(GP_LOG_DEBUG, GP_MODULE "/" __FILE__, msg, ##params)
+/*
+ * GP_LOG_D/E:
+ * simple helper macros for convenient and consistent logging of error
+ * and debug messages including information about the source location.
+ */
+#define GP_LOG_D(...) gp_log(GP_LOG_DEBUG, __func__, __VA_ARGS__)
+#define GP_LOG_E(...) gp_log_with_source_location(GP_LOG_ERROR, __FILE__, __LINE__, __func__, __VA_ARGS__)
+#define GP_LOG_DATA(DATA, SIZE) gp_log_data(__func__, DATA, SIZE)
+
#else
# ifdef __GNUC__
# warning Disabling GP_DEBUG because variadic macros are not allowed
# endif
#define GP_DEBUG (void)
+#define GP_LOG_D(...) /* no-op */
+#define GP_LOG_E(...) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE) /* no-op */
#endif
#endif /* _GPHOTO2_INTERNAL_CODE */
@@ -132,17 +135,23 @@ void gp_log_data (const char *domain, const char *data, unsigned int size);
#define gp_logv(level, domain, format, args) /**/
#define gp_log_data(domain, data, size) /**/
+#ifdef _GPHOTO2_INTERNAL_CODE
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define GP_DEBUG(...) /* no-op */
#define GP_LOG_D(...) /* no-op */
#define GP_LOG_E(...) /* no-op */
#define GP_LOG_DATA(DATA, SIZE) /* no-op */
-#ifdef _GPHOTO2_INTERNAL_CODE
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#define GP_DEBUG(...) /* no-op */
#elif defined(__GNUC__)
#define GP_DEBUG(msg, params...) /* no-op */
+#define GP_LOG_D(...) /* no-op */
+#define GP_LOG_E(...) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE) /* no-op */
#else
#define GP_DEBUG (void)
+#define GP_LOG_D (void /* no-op */
+#define GP_LOG_E (void) /* no-op */
+#define GP_LOG_DATA(DATA, SIZE) /* no-op */
#endif
#endif /* _GPHOTO2_INTERNAL_CODE */