0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

preprocessor symbolでOSを確認しとく

Posted at

なんだかよく使うのでメモ。

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?