aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/shared/general/HACD/public/PlatformConfigHACD.h
blob: e30fee5428166922ee0646b489e7f130b8bbec63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//  * Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//  * Neither the name of NVIDIA CORPORATION nor the names of its
//    contributors may be used to endorse or promote products derived
//    from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Copyright (c) 2018 NVIDIA Corporation. All rights reserved.

#ifndef PLATFORM_CONFIG_H

#define PLATFORM_CONFIG_H

// Modify this header file to make the HACD data types be compatible with your
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <new>

#include "PxSimpleTypes.h"
#include "PxMath.h"
#include "PsAllocator.h"
#include "PsUserAllocated.h"
#include "PsString.h"

#if PX_VC == 9
typedef uint8_t uint8_t;
typedef uint16_t uint16_t;
typedef uint32_t uint32_t;
typedef uint64_t uint64_t;
typedef int8_t int8_t;
typedef int16_t int16_t;
typedef int32_t int32_t;
typedef int64_t int64_t;
#else
#include <stdint.h>
#endif

// This header file provides a brief compatibility layer between the PhysX and APEX SDK foundation header files.
// Modify this header file to your own data types and memory allocation routines and do a global find/replace if necessary

namespace hacd
{

class PxEmpty;

#define HACD_SIGN_BITMASK		0x80000000

	// avoid unreferenced parameter warning (why not just disable it?)
	// PT: or why not just omit the parameter's name from the declaration????
#define HACD_FORCE_PARAMETER_REFERENCE(_P) (void)(_P);
#define HACD_UNUSED(_P) HACD_FORCE_PARAMETER_REFERENCE(_P)

#define HACD_ALLOC_ALIGNED(x,y) PX_ALLOC(x,#x)
#define HACD_ALLOC(x) PX_ALLOC(x,#x)
#define HACD_FREE PX_FREE

#define HACD_ASSERT PX_ASSERT
#define HACD_ALWAYS_ASSERT PX_ALWAYS_ASSERT

#define HACD_INLINE PX_INLINE
#define HACD_NOINLINE PX_NOINLINE
#define HACD_FORCE_INLINE PX_FORCE_INLINE
#define HACD_PLACEMENT_NEW PX_PLACEMENT_NEW

#define HACD_SPRINTF_S physx::shdfnd::snprintf

#define HACD_ISFINITE(x) physx::PxIsFinite(x)

#define HACD_NEW PX_NEW

#if PX_WINDOWS_FAMILY
#define HACD_WINDOWS
#endif

#if PX_VC
#define HACD_VC
#endif

#if PX_VC == 9
#define HACD_VC9
#endif

#if PX_VC == 8
#define HACD_VC8
#endif

#if PX_VC == 7
#define HACD_VC7
#endif

#if PX_VC == 6
#define HACD_VC6
#endif

#if PX_GCC_FAMILY
#define HACD_GNUC
#endif

#if PX_CW
#define HACD_CW
#endif

#if PX_X86
#define HACD_X86
#endif

#if PX_X64
#define HACD_X64
#endif

#if PX_A64
#define HACD_A64
#endif

#if PX_PPC
#define HACD_PPC
#endif

#if PX_PPC64
#define HACD_PPC64
#endif

#if PX_VMX
#define HACD_VMX
#endif

#ifdef  PX_ARM
#define HACD_ARM
#endif

#if PX_WINDOWS_FAMILY
#define HACD_WINDOWS
#endif

#if PX_LINUX_FAMILY
#define HACD_LINUX
#endif

#if PX_ANDROID
#define HACD_ANDROID
#endif

#if PX_APPLE_FAMILY
#define HACD_APPLE
#endif

#if PX_CYGWIN
#define HACD_CYGWIN
#endif

#if PX_WII
#define HACD_WII
#endif

#if PX_GC
#define HACD_GC
#endif


#define HACD_C_EXPORT PX_C_EXPORT
#define HACD_CALL_CONV PX_CALL_CONV
#define HACD_PUSH_PACK_DEFAULT PX_PUSH_PACK_DEFAULT
#define HACD_POP_PACK PX_POP_PACK
#define HACD_INLINE PX_INLINE
#define HACD_FORCE_INLINE PX_FORCE_INLINE
#define HACD_NOINLINE PX_NOINLINE
#define HACD_RESTRICT PX_RESTRICT
#define HACD_NOALIAS PX_NOALIAS
#define HACD_ALIGN PX_ALIGN
#define HACD_ALIGN_PREFIX PX_ALIGN_PREFIX
#define HACD_ALIGN_SUFFIX PX_ALIGN_SUFFIX
#define HACD_DEPRECATED PX_DEPRECATED
#define HACD_JOIN_HELPER PX_JOIN_HELPER
#define HACD_JOIN PX_JOIN
#define HACD_COMPILE_TIME_ASSERT PX_COMPILE_TIME_ASSERT
#define HACD_OFFSET_OF PX_OFFSET_OF
#define HACD_CHECKED PX_CHECKED
#define HACD_CUDA_CALLABLE PX_CUDA_CALLABLE


class ICallback
{
public:
	virtual void ReportProgress(const char *, float progress) = 0;
	virtual bool Cancelled() = 0;
};

#if defined(HACD_X64) || defined(HACD_A64)
typedef uint64_t HaSizeT;
#else
typedef uint32_t HaSizeT;
#endif


}; // end HACD namespace

#define UANS physx::shdfnd	// the user allocator namespace

#define HACD_SQRT(x) float (physx::PxSqrt(x))	
#define HACD_RECIP_SQRT(x) float (physx::PxRecipSqrt(x))	

#include "PxVector.h"



#endif