Unverified Commit 2fbea74d authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4198 from dearblue/missing-macros

Suppress missing macro warns
parents f6c07b88 0bfeefad
......@@ -57,7 +57,7 @@
#define mrb_assert_int_fit(t1,n,t2,max) ((void)0)
#endif
#if __STDC_VERSION__ >= 201112L
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
#define mrb_static_assert(exp, str) _Static_assert(exp, str)
#else
#define mrb_static_assert(exp, str) mrb_assert(exp)
......
......@@ -34,7 +34,7 @@
MRB_BEGIN_DECL
/** Declare a function that never returns. */
#if __STDC_VERSION__ >= 201112L
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
# define mrb_noreturn _Noreturn
#elif defined __GNUC__ && !defined __STRICT_ANSI__
# define mrb_noreturn __attribute__((noreturn))
......
......@@ -209,7 +209,7 @@ mrb_fd_cloexec(mrb_state *mrb, int fd)
#endif
}
#if !defined(_WIN32) && !TARGET_OS_IPHONE
#if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
static int
mrb_cloexec_pipe(mrb_state *mrb, int fildes[2])
{
......@@ -403,7 +403,7 @@ mrb_io_s_popen(mrb_state *mrb, mrb_value klass)
DATA_PTR(io) = fptr;
return io;
}
#elif TARGET_OS_IPHONE
#elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
mrb_value
mrb_io_s_popen(mrb_state *mrb, mrb_value klass)
{
......@@ -1011,7 +1011,7 @@ mrb_io_read_data_pending(mrb_state *mrb, mrb_value io)
return 0;
}
#if !defined(_WIN32) && !TARGET_OS_IPHONE
#if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
static mrb_value
mrb_io_s_pipe(mrb_state *mrb, mrb_value klass)
{
......@@ -1313,7 +1313,7 @@ mrb_init_io(mrb_state *mrb)
mrb_define_class_method(mrb, io, "for_fd", mrb_io_s_for_fd, MRB_ARGS_ANY());
mrb_define_class_method(mrb, io, "select", mrb_io_s_select, MRB_ARGS_ANY());
mrb_define_class_method(mrb, io, "sysopen", mrb_io_s_sysopen, MRB_ARGS_ANY());
#if !defined(_WIN32) && !TARGET_OS_IPHONE
#if !defined(_WIN32) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
mrb_define_class_method(mrb, io, "_pipe", mrb_io_s_pipe, MRB_ARGS_NONE());
#endif
......
......@@ -161,6 +161,10 @@ erfc(double x)
#endif
#if defined __FreeBSD__ && !defined __FreeBSD_version
#include <osreldate.h> /* for __FreeBSD_version */
#endif
#if (defined _MSC_VER && _MSC_VER < 1800) || defined __ANDROID__ || (defined __FreeBSD__ && __FreeBSD_version < 803000)
double
......
......@@ -46,7 +46,7 @@ double round(double x) {
/* #define NO_GMTIME_R */
#ifdef _WIN32
#if _MSC_VER
#ifdef _MSC_VER
/* Win32 platform do not provide gmtime_r/localtime_r; emulate them using gmtime_s/localtime_s */
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL)
#define localtime_r(tp, tm) ((localtime_s((tm), (tp)) == 0) ? (tm) : NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment