replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / c_common / platform_features.h
index 2fdaded..5e1a065 100644 (file)
 #ifndef PLATFORM_FEATURES_H_
 #define PLATFORM_FEATURES_H_
 
+#ifndef __TIZENRT__
+#  if (__cplusplus >=201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+#    define SUPPORTS_DEFAULT_CTOR
+#  endif
+#endif
+
+#ifndef __TIZENRT__
+#  if (__STDC_VERSION__ >= 201112L)
+#    include <assert.h>
+#    define OC_STATIC_ASSERT(condition, msg) static_assert(condition, msg)
+#  elif defined(_WIN32)
+#    if defined(__msys_nt__) && !defined(__cplusplus)
+#      define static_assert _Static_assert
+#    endif
+#    define OC_STATIC_ASSERT(condition, msg) static_assert(condition, msg)
+#  else
+#    define OC_STATIC_ASSERT(condition, msg) ((void)sizeof(char[2*!!(condition) - 1]))
+#  endif
+#endif
+
+#ifndef INLINE_API
+#  if defined(__cplusplus)
+#    define INLINE_API inline
+#  else
+#    ifdef _MSC_VER
+#      define INLINE_API static __inline
+#    else
+#      define INLINE_API static inline
+#    endif
+#  endif
+#endif
+
+#ifdef _MSC_VER
+#  define OC_ANNOTATE_UNUSED
+#else
+#  define OC_ANNOTATE_UNUSED  __attribute__((unused))
+#endif
+
+#ifdef _WIN32
+#  define __func__ __FUNCTION__
+#  define strncasecmp _strnicmp
+#  define strtok_r strtok_s
+#  if _MSC_VER && (_MSC_VER < 1900)
+#    include "windows/include/vs12_snprintf.h"
+#  endif
+#  define ssize_t SSIZE_T
+#  define F_OK                0
+#  define sleep(SECS)         Sleep(1000*(SECS))
+#  ifdef __cplusplus
+#    define SUPPORTS_DEFAULT_CTOR
+#  endif
+#  include "windows/include/win_sleep.h"
+#  include "windows/include/pthread_create.h"
+#endif
 
-#if (__cplusplus >=201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
-    #define SUPPORTS_DEFAULT_CTOR
+#ifdef HAVE_WINSOCK2_H
+#  define OPTVAL_T(t)    (const char*)(t)
+#else
+#  define OPTVAL_T(t)    (t)
 #endif
 
 #endif