なんだかよく使うのでメモ。
define.h
#if defined(_WIN32) || defined(_WIN64)
#
# define OS_WINDOWS
#
#elif defined(__APPLE__)
#
# include "TargetConditionals.h"
# if TARGET_OS_IPHONE
# define OS_IOS
# else
# define OS_OSX
# endif
#
#elif defined(__ANDROID__)
#
# define OS_ANDROID
#
#elif defined(__linux)
#
# define OS_LINUX
#
#else
#
# error unsupported platform
#
#endif