build: Check memory.h presence 91/23191/11
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Tue, 14 Nov 2017 08:01:10 +0000 (09:01 +0100)
committerC.J. Collier <cjcollier@linuxfoundation.org>
Wed, 14 Mar 2018 18:38:16 +0000 (18:38 +0000)
Some systems like TizenRT are not providing this header

Bug: https://jira.iotivity.org/browse/IOT-694
Change-Id: I46b118113241c921d7502f640900d2d7537957d9
Origin: https://gerrit.iotivity.org/gerrit/#/c/23191/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
bridging/common/curlClient.cpp
bridging/include/curlClient.h
resource/c_common/windows/src/memmem.c
resource/csdk/security/provisioning/src/oxmjustworks.c
resource/csdk/security/provisioning/src/oxmmanufacturercert.c
resource/csdk/security/provisioning/src/oxmpreconfpin.c
resource/csdk/security/provisioning/src/oxmrandompin.c
resource/csdk/security/src/strptime.c
service/notification/src/consumer/NSConsumerNetworkEventListener.c
service/notification/src/consumer/NSThread.c

index 6acefa3..5a7004f 100644 (file)
@@ -18,6 +18,7 @@
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 //
+#include "iotivity_config.h"
 
 #include "curlClient.h"
 #include <iostream>
index c8217f3..934a470 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
+// Make sure to include "iotivity_config.h" at begining of c/cpp files
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 #include <string>
 #include <vector>
 #include <map>
index f0ae228..f67495a 100644 (file)
 *
 ******************************************************************/
 
+#include "iotivity_config.h"
+
 #include <stddef.h>
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 
 void *memmem(const void *haystack, size_t haystackLen, const void *needle, size_t needleLen)
 {
index 4d54d2c..dd9604a 100644 (file)
  *
  * *****************************************************************/
 
+#include "iotivity_config.h"
+
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
+
 #include "ocstack.h"
 #include "experimental/securevirtualresourcetypes.h"
 #include "experimental/doxmresource.h"
index 0a7ba2e..0022d95 100644 (file)
  *
  * *****************************************************************/
 
+#include "iotivity_config.h"
+
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 
 #include "ocstack.h"
 #include "experimental/securevirtualresourcetypes.h"
index a0bd5bf..db70349 100644 (file)
  *
  * *****************************************************************/
 
+#include "iotivity_config.h"
+
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 
 #include "ocstack.h"
 #include "experimental/securevirtualresourcetypes.h"
index 8d747e8..9c06bed 100644 (file)
  *
  * *****************************************************************/
 
+#include "iotivity_config.h"
+
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 
 #include "ocstack.h"
 #include "experimental/securevirtualresourcetypes.h"
index 4864199..2bcaadb 100644 (file)
 *
 ******************************************************************/
 
+#include "iotivity_config.h"
+
 #include <stdio.h>
 #include <ctype.h>
 #include <time.h>
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 #include <stdbool.h>
 
 #define TM_BASE_YEAR   1900
index 587761f..e01e31d 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+#include "iotivity_config.h"
+
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 #include <string.h>
 
 #include "NSConstants.h"
index 607e65e..933c1fa 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
+#include "iotivity_config.h"
+
 #include "NSThread.h"
 
 #include "NSConstants.h"
 #include "NSConsumerCommon.h"
-
+#ifdef HAVE_MEMORY_H
 #include <memory.h>
+#endif
 #include "oic_malloc.h"
 
 static pthread_mutex_t g_create_mutex;