X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fc_common%2Fplatform_features.h;h=5e1a06560b5714d846463f8f5246bda14b6f1d17;hb=3c093548382bb2542c87a67e6e5fa32552c29cb3;hp=8f39e19e2feac740dc8b862a7021217f60d927ad;hpb=068b9d878cead4b54ceaba89cb9d9c19b1c5dcb1;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/c_common/platform_features.h b/resource/c_common/platform_features.h index 8f39e19..5e1a065 100644 --- a/resource/c_common/platform_features.h +++ b/resource/c_common/platform_features.h @@ -29,16 +29,65 @@ #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 +# 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 -#if (__cplusplus >=201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__) - #define SUPPORTS_DEFAULT_CTOR +#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 (__STDC_VERSION__ >= 201112L) - #include - #define OC_STATIC_ASSERT(condition, msg) static_assert(condition, msg) +#ifdef HAVE_WINSOCK2_H +# define OPTVAL_T(t) (const char*)(t) #else - #define OC_STATIC_ASSERT(condition, msg) ((void)sizeof(char[2*!!(condition) - 1])) +# define OPTVAL_T(t) (t) #endif #endif