# Conflicts: # Source/Platforms/DotNet/NUnit/agents/net40/nunit-agent.exe # Source/Platforms/DotNet/NUnit/agents/net40/nunit.engine.api.dll # Source/Platforms/DotNet/NUnit/agents/net40/nunit.engine.core.dll # Source/Platforms/DotNet/NUnit/agents/net7.0/nunit.agent.addins # Source/Platforms/DotNet/NUnit/nunit.engine.api.dll # Source/Platforms/DotNet/NUnit/nunit.engine.core.dll # Source/Platforms/DotNet/NUnit/nunit.engine.dll # Source/Platforms/DotNet/NUnit/nunit3-console.exe # Source/Platforms/DotNet/NUnit/nunit3-console.exe.config # Source/Platforms/DotNet/NUnit/testcentric.engine.metadata.dll # Source/Tools/Flax.Build/Deps/Downloader.cs # Source/Tools/Flax.Stats/CodeFrame.cs # Source/Tools/Flax.Stats/CodeFrameNode.cs # Source/Tools/Flax.Stats/Flax.Stats.Build.cs # Source/Tools/Flax.Stats/Languages.cs # Source/Tools/Flax.Stats/Program.cs # Source/Tools/Flax.Stats/TaskType.cs # Source/Tools/Flax.Stats/Tools.cs # Source/Tools/FlaxEngine.Tests/TestEditorUtils.cs
100 lines
3.1 KiB
C
100 lines
3.1 KiB
C
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
|
|
|
#pragma once
|
|
|
|
#if defined(__clang__)
|
|
|
|
#define DLLEXPORT __attribute__ ((__visibility__ ("default")))
|
|
#define DLLIMPORT
|
|
#define THREADLOCAL __thread
|
|
#define STDCALL __attribute__((stdcall))
|
|
#define CDECL __attribute__((cdecl))
|
|
#define RESTRICT __restrict__
|
|
#define INLINE inline
|
|
#define FORCE_INLINE inline
|
|
#define FORCE_NOINLINE __attribute__((noinline))
|
|
#define NO_RETURN __attribute__((noreturn))
|
|
#define PACK_BEGIN()
|
|
#define PACK_END() __attribute__((__packed__))
|
|
#define ALIGN_BEGIN(_align)
|
|
#define ALIGN_END(_align) __attribute__( (aligned(_align) ) )
|
|
#define OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
|
|
#define DEPRECATED [[deprecated]]
|
|
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS \
|
|
_Pragma("clang diagnostic push") \
|
|
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
|
|
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS \
|
|
_Pragma("clang diagnostic pop")
|
|
|
|
#pragma clang diagnostic ignored "-Wswitch"
|
|
#pragma clang diagnostic ignored "-Wmacro-redefined"
|
|
#pragma clang diagnostic ignored "-Waddress-of-packed-member"
|
|
#pragma clang diagnostic ignored "-Wnull-dereference"
|
|
#pragma clang diagnostic ignored "-Winvalid-noreturn"
|
|
|
|
#define SCRIPTING_EXPORT(name)
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
#define DLLEXPORT __attribute__ ((__visibility__ ("default")))
|
|
#define DLLIMPORT
|
|
#define THREADLOCAL __thread
|
|
#define STDCALL __attribute__((stdcall))
|
|
#define CDECL __attribute__((cdecl))
|
|
#define RESTRICT __restrict__
|
|
#define INLINE inline
|
|
#define FORCE_INLINE inline
|
|
#define FORCE_NOINLINE __attribute__((noinline))
|
|
#define NO_RETURN __attribute__((noreturn))
|
|
#define PACK_BEGIN()
|
|
#define PACK_END() __attribute__((__packed__))
|
|
#define ALIGN_BEGIN(_align)
|
|
#define ALIGN_END(_align) __attribute__( (aligned(_align) ) )
|
|
#define OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
|
|
#define DEPRECATED [[deprecated]]
|
|
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#if _MSC_VER < 1900
|
|
#error "Required Visual Studio 2015 or newer."
|
|
#endif
|
|
|
|
#define DLLEXPORT __declspec(dllexport)
|
|
#define DLLIMPORT __declspec(dllimport)
|
|
#define THREADLOCAL __declspec(thread)
|
|
#define STDCALL __stdcall
|
|
#define CDECL __cdecl
|
|
#define RESTRICT __restrict
|
|
#define INLINE __inline
|
|
#define FORCE_INLINE __forceinline
|
|
#define FORCE_NOINLINE __declspec(noinline)
|
|
#define NO_RETURN __declspec(noreturn)
|
|
#define PACK_BEGIN() __pragma(pack(push, 1))
|
|
#define PACK_END() ; __pragma(pack(pop))
|
|
#define ALIGN_BEGIN(_align) __declspec(align(_align))
|
|
#define ALIGN_END(_align)
|
|
#define OFFSET_OF(X, Y) offsetof(X, Y)
|
|
#define DEPRECATED __declspec(deprecated)
|
|
#undef __PRETTY_FUNCTION__
|
|
#define __PRETTY_FUNCTION__ __FUNCSIG__
|
|
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS \
|
|
__pragma(warning(push)) \
|
|
__pragma(warning(disable: 4995)) \
|
|
__pragma(warning(disable: 4996))
|
|
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS \
|
|
__pragma (warning(pop))
|
|
|
|
#pragma warning(disable: 4251)
|
|
|
|
#define SCRIPTING_EXPORT(name) __pragma(comment(linker, "/EXPORT:" #name "=" __FUNCDNAME__))
|
|
|
|
#else
|
|
|
|
#pragma error "Unknown compiler."
|
|
|
|
#endif
|
|
|
|
#define PACK_STRUCT(__Declaration__) PACK_BEGIN() __Declaration__ PACK_END()
|