Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
Types.hh
Go to the documentation of this file.
1//
2// MIT License
3// Copyright (c) 2020 Jonathan R. Madsen
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
12// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
13// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
16// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
17// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18//
19// Tasking native types
20//
21
22#pragma once
23
24#if defined(__APPLE__) || defined(__MACH__)
25# if !defined(PTL_MACOS)
26# define PTL_MACOS 1
27# endif
28# if !defined(PTL_UNIX)
29# define PTL_UNIX 1
30# endif
31#endif
32
33#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
34# if !defined(PTL_WINDOWS)
35# define PTL_WINDOWS 1
36# endif
37#endif
38
39#if defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
40# if !defined(PTL_LINUX)
41# define PTL_LINUX 1
42# endif
43# if !defined(PTL_UNIX)
44# define PTL_UNIX 1
45# endif
46#endif
47
48#if defined(__unix__) || defined(__unix) || defined(unix)
49# if !defined(PTL_UNIX)
50# define PTL_UNIX 1
51# endif
52#endif
53
54#if defined(PTL_WINDOWS)
55// Disable warning C4786 on WIN32 architectures:
56// identifier was truncated to '255' characters
57// in the debug information
58//
59# pragma warning(disable : 4786)
60//
61// Define DLL export macro for WIN32 systems for
62// importing/exporting external symbols to DLLs
63//
64# if defined PTL_BUILD_DLL
65# define DLLEXPORT __declspec(dllexport)
66# define DLLIMPORT __declspec(dllimport)
67# else
68# define DLLEXPORT
69# define DLLIMPORT
70# endif
71//
72// Unique identifier for global module
73//
74# if defined PTL_ALLOC_EXPORT
75# define PTL_DLL DLLEXPORT
76# else
77# define PTL_DLL DLLIMPORT
78# endif
79#else
80# define DLLEXPORT
81# define DLLIMPORT
82# define PTL_DLL
83#endif
84
85#if !defined(PTL_DEFAULT_OBJECT)
86# define PTL_DEFAULT_OBJECT(NAME) \
87 NAME() = default; \
88 ~NAME() = default; \
89 NAME(const NAME&) = default; \
90 NAME(NAME&&) = default; \
91 NAME& operator=(const NAME&) = default; \
92 NAME& operator=(NAME&&) = default;
93#endif