Relicence all source and header files included in LGPL code
[lttng-tools.git] / src / common / error.h
index c4aa4012aa4aaed38c0e1a25154c78419467f0c0..b3e19c433cff5ff271fdbd564b70e7de0d1ee57e 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  *
- * SPDX-License-Identifier: GPL-2.0-only
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
  */
 
@@ -43,7 +43,7 @@ struct log_time {
        /* Format: 00:00:00.000000000 plus NULL byte. */
        char str[19];
 };
-extern DECLARE_URCU_TLS(struct log_time, error_log_time);
+extern LTTNG_EXPORT  DECLARE_URCU_TLS(struct log_time, error_log_time);
 extern DECLARE_URCU_TLS(const char *, logger_thread_name);
 
 extern int lttng_opt_quiet;
@@ -108,7 +108,7 @@ static inline bool __lttng_print_check_opt(enum lttng_error_level type)
        return true;
 }
 
-void lttng_abort_on_error(void);
+C_LINKAGE void lttng_abort_on_error(void);
 
 static inline void __lttng_print_check_abort(enum lttng_error_level type)
 {
@@ -221,7 +221,7 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)
                        DBG3(fmt, ## args);     \
                        break;                  \
                default:                        \
-                       assert(0);              \
+                       abort();                \
                }                               \
        } while(0);
 
@@ -232,23 +232,24 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)
 /*
  * Version using XSI strerror_r.
  */
-#define PERROR(call, args...) \
-       do { \
-               char buf[200]; \
-               strerror_r(errno, buf, sizeof(buf)); \
-               _PERROR(call ": %s", ## args, buf); \
-       } while(0);
+#define PERROR(call, args...)                                        \
+       do {                                                         \
+               char _perror_buf[200];                               \
+               strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
+               _PERROR(call ": %s", ##args, _perror_buf);           \
+       } while (0);
 #else
 /*
  * Version using GNU strerror_r, for linux with appropriate defines.
  */
-#define PERROR(call, args...) \
-       do { \
-               char *buf; \
-               char tmp[200]; \
-               buf = strerror_r(errno, tmp, sizeof(tmp)); \
-               _PERROR(call ": %s", ## args, buf); \
-       } while(0);
+#define PERROR(call, args...)                                             \
+       do {                                                              \
+               char *_perror_buf;                                        \
+               char _perror_tmp[200];                                    \
+               _perror_buf = strerror_r(                                 \
+                               errno, _perror_tmp, sizeof(_perror_tmp)); \
+               _PERROR(call ": %s", ##args, _perror_buf);                \
+       } while (0);
 #endif
 
 const char *error_get_str(int32_t code);
@@ -261,7 +262,6 @@ const char *error_get_str(int32_t code);
 const char *log_add_time(void);
 
 /* Name must be a statically-allocated string. */
-LTTNG_HIDDEN
 void logger_set_thread_name(const char *name, bool set_pthread_name);
 
 #endif /* _ERROR_H */
This page took 0.024034 seconds and 4 git commands to generate.