Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
PlatformDefinesUnix.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33
34#ifndef DVD_PLATFORM_DEFINES_UNIX_H_
35#define DVD_PLATFORM_DEFINES_UNIX_H_
36
37#ifndef _RESTRICT_
38#define _RESTRICT_ __restrict__
39#endif
40
41#ifndef NOINITVTABLE
42#define NOINITVTABLE
43#endif //NOINITVTABLE
44
45#ifndef FORCE_INLINE
46#define FORCE_INLINE inline __attribute__((always_inline))
47#endif //FORCE_INLINE
48
49#ifndef NO_INLINE
50#define NO_INLINE __attribute__ ((noinline))
51#endif //NO_INLINE
52
53#include <sys/time.h>
54#include <X11/X.h>
55#include <strings.h>
56//#include <iterator>
57#include <cmath>
58
59namespace std
60{
61 [[nodiscard]] inline float asinf(const float in)
62 {
63 return ::asinf(in);
64 }
65
66 [[nodiscard]] inline float acosf(const float in)
67 {
68 return ::acosf(in);
69 }
70
71 [[nodiscard]] inline float floorf(const float in)
72 {
73 return ::floorf(in);
74 }
75};
76
77#ifdef None
78#undef None
79#endif //None
80
81#ifdef True
82#undef True
83#endif //True
84
85#ifdef False
86#undef False
87#endif //False
88
89#ifdef Success
90#undef Success
91#endif //Success
92
93#ifdef Always
94#undef Always
95#endif //Always
96
97namespace Divide {
98 struct WindowHandle {
99 Window _handle;
100 };
101
102}; //namespace Divide
103
104template <typename T>
105bool isfinite(T val) {
106 return std::isfinite(val);
107}
108
109inline int _strnicmp(const char* str1, const char* str2, unsigned long int n) {
110 return strncasecmp(str1, str2, n);
111}
112
113inline int _stricmp(const char* str1, const char* str2) {
114 return strcasecmp(str1, str2);
115}
116
117#endif //DVD_PLATFORM_DEFINES_UNIX_H_
int _stricmp(const char *str1, const char *str2)
bool isfinite(T val)
int _strnicmp(const char *str1, const char *str2, unsigned long int n)
#define strncasecmp
#define strcasecmp
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
float floorf(const float in)
float asinf(const float in)
float acosf(const float in)