2018-05-10 09:46:34 +03:00
|
|
|
// Copyright 2018 Slightech Co., Ltd. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2018-03-11 18:15:30 +02:00
|
|
|
#ifndef MYNTEYE_GLOBAL_H_
|
|
|
|
#define MYNTEYE_GLOBAL_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_WIN
|
|
|
|
#ifdef _WIN64
|
|
|
|
#define MYNTEYE_OS_WIN64
|
|
|
|
#else
|
|
|
|
#define MYNTEYE_OS_WIN32
|
|
|
|
#endif
|
|
|
|
#if defined(__MINGW32__) || defined(__MINGW64__)
|
|
|
|
#define MYNTEYE_OS_MINGW
|
|
|
|
#ifdef __MINGW64__
|
|
|
|
#define MYNTEYE_OS_MINGW64
|
|
|
|
#else
|
|
|
|
#define MYNTEYE_OS_MINGW32
|
|
|
|
#endif
|
|
|
|
#elif defined(__CYGWIN__) || defined(__CYGWIN32__)
|
|
|
|
#define MYNTEYE_OS_CYGWIN
|
|
|
|
#endif
|
2018-03-11 18:15:30 +02:00
|
|
|
#elif __APPLE__
|
2018-09-11 05:19:25 +03:00
|
|
|
#include <TargetConditionals.h>
|
|
|
|
#if TARGET_IPHONE_SIMULATOR
|
|
|
|
#define MYNTEYE_OS_IPHONE
|
|
|
|
#define MYNTEYE_OS_IPHONE_SIMULATOR
|
|
|
|
#elif TARGET_OS_IPHONE
|
|
|
|
#define MYNTEYE_OS_IPHONE
|
|
|
|
#elif TARGET_OS_MAC
|
|
|
|
#define MYNTEYE_OS_MAC
|
|
|
|
#else
|
|
|
|
#error "Unknown Apple platform"
|
|
|
|
#endif
|
2018-03-11 18:15:30 +02:00
|
|
|
#elif __ANDROID__
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_ANDROID
|
2018-03-11 18:15:30 +02:00
|
|
|
#elif __linux__
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_LINUX
|
2018-03-11 18:15:30 +02:00
|
|
|
#elif __unix__
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_UNIX
|
2018-03-11 18:15:30 +02:00
|
|
|
#elif defined(_POSIX_VERSION)
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_POSIX
|
2018-03-11 18:15:30 +02:00
|
|
|
#else
|
2018-09-11 05:19:25 +03:00
|
|
|
#error "Unknown compiler"
|
2018-03-11 18:15:30 +02:00
|
|
|
#endif
|
|
|
|
|
2018-09-11 05:19:25 +03:00
|
|
|
#ifdef MYNTEYE_OS_WIN
|
|
|
|
#define MYNTEYE_DECL_EXPORT __declspec(dllexport)
|
|
|
|
#define MYNTEYE_DECL_IMPORT __declspec(dllimport)
|
|
|
|
#define MYNTEYE_DECL_HIDDEN
|
2018-03-11 18:15:30 +02:00
|
|
|
#else
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_DECL_EXPORT __attribute__((visibility("default")))
|
|
|
|
#define MYNTEYE_DECL_IMPORT __attribute__((visibility("default")))
|
|
|
|
#define MYNTEYE_DECL_HIDDEN __attribute__((visibility("hidden")))
|
2018-03-11 18:15:30 +02:00
|
|
|
#endif
|
|
|
|
|
2018-09-11 05:19:25 +03:00
|
|
|
#if defined(MYNTEYE_OS_WIN) && !defined(MYNTEYE_OS_MINGW) && \
|
|
|
|
!defined(MYNTEYE_OS_CYGWIN)
|
|
|
|
#define MYNTEYE_OS_SEP "\\"
|
2018-03-11 18:15:30 +02:00
|
|
|
#else
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_OS_SEP "/"
|
2018-03-11 18:15:30 +02:00
|
|
|
#endif
|
|
|
|
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_STRINGIFY_HELPER(X) #X
|
|
|
|
#define MYNTEYE_STRINGIFY(X) MYNTEYE_STRINGIFY_HELPER(X)
|
2018-03-11 18:15:30 +02:00
|
|
|
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_DISABLE_COPY(Class) \
|
2018-03-11 18:15:30 +02:00
|
|
|
Class(const Class &) = delete; \
|
|
|
|
Class &operator=(const Class &) = delete;
|
|
|
|
|
2018-09-11 05:19:25 +03:00
|
|
|
#define MYNTEYE_UNUSED(x) (void)x;
|
2018-03-11 18:15:30 +02:00
|
|
|
|
|
|
|
#endif // MYNTEYE_GLOBAL_H_
|