osx/iphone fixes.
This commit is contained in:
parent
188d5043d8
commit
4bbf62855c
@ -326,9 +326,17 @@ namespace
|
||||
# if NV_CPU_PPC
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext->__ss.__srr0;
|
||||
# elif NV_CPU_X86_64
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext->__ss.__rip;
|
||||
# elif NV_CPU_X86
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext->__ss.__eip;
|
||||
# elif NV_CPU_ARM
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext->__ss.__pc;
|
||||
# else
|
||||
# error "Unknown CPU"
|
||||
# endif
|
||||
# else
|
||||
# if NV_CPU_PPC
|
||||
@ -337,16 +345,20 @@ namespace
|
||||
# elif NV_CPU_X86
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext->ss.eip;
|
||||
# else
|
||||
# error "Unknown CPU"
|
||||
# endif
|
||||
# endif
|
||||
# elif NV_OS_FREEBSD
|
||||
# if NV_CPU_X86_64
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *)ucp->uc_mcontext.mc_rip;
|
||||
# elif NV_CPU_X86
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *)ucp->uc_mcontext.mc_eip;
|
||||
# endif
|
||||
#elif NV_OS_FREEBSD
|
||||
# if NV_CPU_X86_64
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *)ucp->uc_mcontext.mc_rip;
|
||||
# elif NV_CPU_X86
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *)ucp->uc_mcontext.mc_eip;
|
||||
# else
|
||||
# error "Unknown CPU"
|
||||
# endif
|
||||
#else
|
||||
# if NV_CPU_X86_64
|
||||
// #define REG_RIP REG_INDEX(rip) // seems to be 16
|
||||
@ -358,7 +370,9 @@ namespace
|
||||
# elif NV_CPU_PPC
|
||||
ucontext_t * ucp = (ucontext_t *)secret;
|
||||
return (void *) ucp->uc_mcontext.regs->nip;
|
||||
# endif
|
||||
# else
|
||||
# error "Unknown CPU"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// How to obtain the instruction pointers in different platforms, from mlton's source code.
|
||||
|
@ -3,7 +3,7 @@
|
||||
#endif
|
||||
|
||||
//#include <stdint.h> // uint8_t, int8_t, ...
|
||||
//#include <cstddef> // size_t, NULL
|
||||
#include <cstddef> // operator new, size_t, NULL
|
||||
|
||||
// Function linkage
|
||||
#define DLL_IMPORT
|
||||
|
@ -67,6 +67,7 @@
|
||||
// NV_CPU_X86
|
||||
// NV_CPU_X86_64
|
||||
// NV_CPU_PPC
|
||||
// NV_CPU_ARM
|
||||
|
||||
#define NV_CPU_STRING POSH_CPU_STRING
|
||||
|
||||
@ -76,6 +77,8 @@
|
||||
# define NV_CPU_X86 1
|
||||
#elif defined POSH_CPU_PPC
|
||||
# define NV_CPU_PPC 1
|
||||
#elif defined POSH_CPU_STRONGARM
|
||||
# define NV_CPU_ARM 1
|
||||
#else
|
||||
# error "Unsupported CPU"
|
||||
#endif
|
||||
@ -128,21 +131,19 @@ typedef uint32 uint;
|
||||
NV_ENDIAN_STRING"-endian - " __DATE__ "-" __TIME__
|
||||
|
||||
|
||||
/// Disable copy constructor and assignment operator.
|
||||
/// @hideinitializer
|
||||
// Disable copy constructor and assignment operator.
|
||||
#define NV_FORBID_COPY(C) \
|
||||
private: \
|
||||
C( const C & ); \
|
||||
C &operator=( const C & );
|
||||
|
||||
|
||||
/// Disable dynamic allocation on the heap.
|
||||
/// See Prohibiting Heap-Based Objects in More Effective C++.
|
||||
/// @hideinitializer
|
||||
// Disable dynamic allocation on the heap.
|
||||
// See Prohibiting Heap-Based Objects in More Effective C++.
|
||||
#define NV_FORBID_HEAPALLOC() \
|
||||
private: \
|
||||
static void *operator new(size_t size); \
|
||||
static void *operator new[](size_t size);
|
||||
void *operator new(size_t size); \
|
||||
void *operator new[](size_t size);
|
||||
|
||||
// String concatenation macros.
|
||||
#define NV_STRING_JOIN2(arg1, arg2) NV_DO_STRING_JOIN2(arg1, arg2)
|
||||
@ -172,14 +173,13 @@ typedef uint32 uint;
|
||||
NV_STRING_JOIN3(AtStartup_, __LINE__, Instance); \
|
||||
};
|
||||
|
||||
/// Indicate the compiler that the parameter is not used to suppress compier warnings.
|
||||
/// @hideinitializer
|
||||
// Indicate the compiler that the parameter is not used to suppress compier warnings.
|
||||
#define NV_UNUSED(a) ((a)=(a))
|
||||
|
||||
/// Null index. @@ Move this somewhere else... it's only used by nvmesh.
|
||||
// Null index. @@ Move this somewhere else... it's only used by nvmesh.
|
||||
//const unsigned int NIL = unsigned int(~0);
|
||||
|
||||
/// Null pointer.
|
||||
// Null pointer.
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user