Hey, all!

I believe the modification below addresses the problem of building
against the headers without having to provide paths to the logging
headers, although, ideally, the logging should be moved to a separate
header file, which should only be included where needed. From

find -type f | grep -vE '(\.git|out)' | awk '{ printf ( $0 "\0" ); }'
| xargs -0 grep -niH '#include "ocpayload\.h"' | awk -F ':' '{ print
$1; }' | sort -u | xargs grep -niH OC_LOG_PAYLOAD | awk -F ':' '{
print $1;}' | sort -u

it seems that, aside from occollection.c, OC_LOG_PAYLOAD is only
needed in the samples. So, perhaps, this logging should be moved to a
header file referred only from the samples instead.

HTH,



Gabriel

commit acd5f72abba0982a002bfc3b226de4d20f055162
Author: Gabriel Schulhof <gabriel.schulhof at intel.com>
Date:   Wed Aug 5 13:47:53 2015 +0300

    CSDK: Only include logging.h if TB_LOG is defined

diff --git a/resource/csdk/stack/include/ocpayload.h
b/resource/csdk/stack/include/ocpayload.h
index 91776c4..b2487dd 100644
--- a/resource/csdk/stack/include/ocpayload.h
+++ b/resource/csdk/stack/include/ocpayload.h
@@ -23,7 +23,6 @@

 #include <stdbool.h>
 #include <inttypes.h>
-#include "logger.h"
 #include "octypes.h"

 #ifdef __cplusplus
@@ -34,6 +33,7 @@ extern "C"
 typedef struct OCResource OCResource;

 #ifdef TB_LOG
+#include "logger.h"
     #define OC_LOG_PAYLOAD(level, tag, payload)
OCPayloadLog((level),(tag),(payload))
     #define UUID_SIZE (16)
     #define UUID_LENGTH (37)

Reply via email to