Spinning Topp Logo BlackTopp Studios
inc
crossplatformincludes.h
Go to the documentation of this file.
1 // The DAGFrameScheduler is a Multi-Threaded lock free and wait free scheduling library.
2 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
3 /* This file is part of The DAGFrameScheduler.
4 
5  The DAGFrameScheduler is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  The DAGFrameScheduler is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with The DAGFrameScheduler. If not, see <http://www.gnu.org/licenses/>.
17 */
18 /* The original authors have included a copy of the license specified above in the
19  'doc' folder. See 'gpl.txt'
20 */
21 /* We welcome the use of the DAGFrameScheduler to anyone, including companies who wish to
22  Build professional software and charge for their product.
23 
24  However there are some practical restrictions, so if your project involves
25  any of the following you should contact us and we will try to work something
26  out:
27  - DRM or Copy Protection of any kind(except Copyrights)
28  - Software Patents You Do Not Wish to Freely License
29  - Any Kind of Linking to Non-GPL licensed Works
30  - Are Currently In Violation of Another Copyright Holder's GPL License
31  - If You want to change our code and not add a few hundred MB of stuff to
32  your distribution
33 
34  These and other limitations could cause serious legal problems if you ignore
35  them, so it is best to simply contact us or the Free Software Foundation, if
36  you have any questions.
37 
38  Joseph Toppi - toppij@gmail.com
39  John Blackwood - makoenergy02@gmail.com
40 */
41 #ifndef _crossplatformincludes_h
42 #define _crossplatformincludes_h
43 
44  /// @file
45  /// @brief This file determines what features are offered by the compiler that this library can take advantage of.
46  /// @details This file is dropped when integrating with the Mezzanine. Its contents are manually merged with
47  /// crossplatformexport.h instead.
48 
49  // Parts of this library use the TinyThread++ libary and those parts are also covered by the following license
50  /*
51  Copyright (c) 2010-2012 Marcus Geelnard
52 
53  This software is provided 'as-is', without any express or implied
54  warranty. In no event will the authors be held liable for any damages
55  arising from the use of this software.
56 
57  Permission is granted to anyone to use this software for any purpose,
58  including commercial applications, and to alter it and redistribute it
59  freely, subject to the following restrictions:
60 
61  1. The origin of this software must not be misrepresented; you must not
62  claim that you wrote the original software. If you use this software
63  in a product, an acknowledgment in the product documentation would be
64  appreciated but is not required.
65 
66  2. Altered source versions must be plainly marked as such, and must not be
67  misrepresented as being the original software.
68 
69  3. This notice may not be removed or altered from any source
70  distribution.
71  */
72 
73 #include "crossplatformexport.h"
74 
75 /// @file
76 /// @brief Include headers for common tasks like those offered by the Posix or win32 API
77 /// @warning Do not include in headers even if it appears to work. The windows headers
78 /// heartlessly set preprocessor macros to names that a sane person would use for functions.
79 /// So even if said function is on a class or in a namespace the poor underprivileged
80 /// developers designing windows still clobber other's well behaved code.
81 
82 #ifdef _MEZZ_THREAD_WIN32_
83  #ifdef _MSC_VER
84  #pragma warning( disable : 4251) // Disable the dll import/export warnings on items that are set correctly.
85  #pragma warning( disable : 4244) // Disable the double to float conversions, they are in their by design to minimize floating point rounding during intermediate calculations.
86  #pragma warning( disable : 4127) // Disable conditional expression is constant
87  #pragma warning( disable : 4800) // pugi xml unspecified bool type coercion has performance cost, used only in unit tests
88  #pragma warning( disable : 4221) // interfaces don't generate linkable symbols, well of course they don't
89  #pragma warning( disable : 4512) // Could not generate assignment operator for class that doesn't need one
90  #endif
91  #ifndef WIN32_LEAN_AND_MEAN
92  #define WIN32_LEAN_AND_MEAN
93  #define __UNDEF_LEAN_AND_MEAN
94  #endif
95  #ifndef NOMINMAX
96  #define NOMINMAX
97  #endif
98  #include <windows.h>
99  #include <process.h>
100  #ifdef __UNDEF_LEAN_AND_MEAN
101  #undef WIN32_LEAN_AND_MEAN
102  #undef __UNDEF_LEAN_AND_MEAN
103  #endif
104 #else
105  #include <pthread.h>
106  #include <signal.h>
107  #include <sched.h>
108  #include <unistd.h>
109 #endif
110 
111 #endif // include guard
This file is used on some platforms to determine what data should be read and written to and from a s...