summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2021-07-28 10:39:38 +0900
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2021-10-05 11:07:37 +0900
commitcafa943089779bdc79b879898d11abf9c7521fbe (patch)
treec16caaaf25ab0b81555a755b587677098b8698e3
parent876575189a199b0a35c3fa0adc37f5e3ca1b3fc8 (diff)
downloadDLT-daemon-cafa943089779bdc79b879898d11abf9c7521fbe.tar.gz
header: Adapt to DLT_DISABLE_MACRO
If dlt.h is included in external application, it needed to include -DDLT_DISABLE_MACRO to make ifdef switch work. This commit adds DLT_DISABLE_MACRO in dlt_user.h so that no additional definition is needed in application. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
-rw-r--r--CMakeLists.txt4
-rw-r--r--include/dlt/CMakeLists.txt4
-rw-r--r--include/dlt/dlt_user.h.in6
-rw-r--r--src/adaptor/dlt-adaptor-stdin.c1
-rw-r--r--src/adaptor/dlt-adaptor-udp.c2
-rw-r--r--src/dlt-qnx-system/dlt-qnx-system.h1
-rw-r--r--src/lib/dlt_filetransfer.c1
7 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4bf8df..a45c3c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,10 +156,6 @@ if(WITH_DLT_USE_IPv6)
add_definitions(-DDLT_USE_IPv6)
endif()
-if(WITH_DLT_DISABLE_MACRO)
- add_definitions(-DDLT_DISABLE_MACRO)
-endif()
-
if(WITH_DLT_QNX_SYSTEM AND NOT "${CMAKE_C_COMPILER}" MATCHES "nto-qnx|qcc")
message(FATAL_ERROR "Can only compile for QNX with a QNX compiler.")
endif()
diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt
index 9362821..ae05cc3 100644
--- a/include/dlt/CMakeLists.txt
+++ b/include/dlt/CMakeLists.txt
@@ -13,6 +13,10 @@
# For further information see http://www.genivi.org/.
#######
+if(WITH_DLT_DISABLE_MACRO)
+ set(DLT_DISABLE_MACRO 1)
+endif()
+
configure_file(dlt_user.h.in dlt_user.h)
set(HEADER_LIST dlt.h dlt_user_macros.h dlt_client.h dlt_protocol.h
diff --git a/include/dlt/dlt_user.h.in b/include/dlt/dlt_user.h.in
index 7a2d35e..2c42603 100644
--- a/include/dlt/dlt_user.h.in
+++ b/include/dlt/dlt_user.h.in
@@ -78,6 +78,8 @@
#cmakedefine DLT_NETWORK_TRACE_ENABLE
#endif
+#cmakedefine01 DLT_DISABLE_MACRO
+
#ifdef DLT_NETWORK_TRACE_ENABLE
# include <mqueue.h>
#else
@@ -92,8 +94,10 @@
# endif
# include "dlt_types.h"
-# include "dlt_user_macros.h"
# include "dlt_shm.h"
+#if !DLT_DISABLE_MACRO
+# include "dlt_user_macros.h"
+#endif
# ifdef __cplusplus
extern "C" {
diff --git a/src/adaptor/dlt-adaptor-stdin.c b/src/adaptor/dlt-adaptor-stdin.c
index 304aca0..1df415c 100644
--- a/src/adaptor/dlt-adaptor-stdin.c
+++ b/src/adaptor/dlt-adaptor-stdin.c
@@ -69,6 +69,7 @@
#include "dlt_common.h"
#include "dlt_user.h"
+#include "dlt_user_macros.h"
#define MAXSTRLEN 1024
diff --git a/src/adaptor/dlt-adaptor-udp.c b/src/adaptor/dlt-adaptor-udp.c
index cd62d49..b2033de 100644
--- a/src/adaptor/dlt-adaptor-udp.c
+++ b/src/adaptor/dlt-adaptor-udp.c
@@ -75,6 +75,8 @@
#include "dlt_common.h"
#include "dlt_user.h"
+#include "dlt_user_macros.h"
+
/* Port number, to which the syslogd-ng sends its log messages */
#define RCVPORT 47111
diff --git a/src/dlt-qnx-system/dlt-qnx-system.h b/src/dlt-qnx-system/dlt-qnx-system.h
index 270b8be..ad6dc64 100644
--- a/src/dlt-qnx-system/dlt-qnx-system.h
+++ b/src/dlt-qnx-system/dlt-qnx-system.h
@@ -52,6 +52,7 @@
#define DLT_QNX_SYSTEM_H_
#include "dlt.h"
+#include "dlt_user_macros.h"
/* Constants */
#define DEFAULT_CONF_FILE ( CONFIGURATION_FILES_DIR "/dlt-qnx-system.conf")
diff --git a/src/lib/dlt_filetransfer.c b/src/lib/dlt_filetransfer.c
index 081893b..78084f0 100644
--- a/src/lib/dlt_filetransfer.c
+++ b/src/lib/dlt_filetransfer.c
@@ -56,6 +56,7 @@
#include <string.h>
#include "dlt_filetransfer.h"
#include "dlt_common.h"
+#include "dlt_user_macros.h"
/*!Defines the buffer size of a single file package which will be logged to dlt */
#define BUFFER_SIZE 1024