File indexing completed on 2025-08-02 08:28:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #pragma once
0021
0022 #if defined(__APPLE__) || defined(__MACH__)
0023 # if !defined(PTL_MACOS)
0024 # define PTL_MACOS 1
0025 # endif
0026 # if !defined(PTL_UNIX)
0027 # define PTL_UNIX 1
0028 # endif
0029 #endif
0030
0031 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
0032 # if !defined(PTL_WINDOWS)
0033 # define PTL_WINDOWS 1
0034 # endif
0035 #endif
0036
0037 #if defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
0038 # if !defined(PTL_LINUX)
0039 # define PTL_LINUX 1
0040 # endif
0041 # if !defined(PTL_UNIX)
0042 # define PTL_UNIX 1
0043 # endif
0044 #endif
0045
0046 #if defined(__unix__) || defined(__unix) || defined(unix)
0047 # if !defined(PTL_UNIX)
0048 # define PTL_UNIX 1
0049 # endif
0050 #endif
0051
0052 #if defined(PTL_WINDOWS)
0053
0054
0055
0056
0057 # pragma warning(disable : 4786)
0058
0059
0060
0061
0062 # if defined PTL_BUILD_DLL
0063 # define DLLEXPORT __declspec(dllexport)
0064 # define DLLIMPORT __declspec(dllimport)
0065 # else
0066 # define DLLEXPORT
0067 # define DLLIMPORT
0068 # endif
0069
0070
0071
0072 # if defined PTL_ALLOC_EXPORT
0073 # define PTL_DLL DLLEXPORT
0074 # else
0075 # define PTL_DLL DLLIMPORT
0076 # endif
0077 #else
0078 # define DLLEXPORT
0079 # define DLLIMPORT
0080 # define PTL_DLL
0081 #endif
0082
0083 #if !defined(PTL_DEFAULT_OBJECT)
0084 # define PTL_DEFAULT_OBJECT(NAME) \
0085 NAME() = default; \
0086 ~NAME() = default; \
0087 NAME(const NAME&) = default; \
0088 NAME(NAME&&) = default; \
0089 NAME& operator=(const NAME&) = default; \
0090 NAME& operator=(NAME&&) = default;
0091 #endif
0092
0093 #if !defined(PTL_NO_SANITIZE_THREAD)
0094
0095 # if defined(__has_attribute)
0096 # if __has_attribute(no_sanitize)
0097 # define PTL_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread")))
0098 # else
0099 # define PTL_NO_SANITIZE_THREAD
0100 # endif
0101 # elif defined(__clang__) || defined(__GNUC__)
0102 # define PTL_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread")))
0103 # else
0104
0105 # define PTL_NO_SANITIZE_THREAD
0106 # endif
0107 #endif