mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Bunch of minor compile fixes and changes
This commit is contained in:
parent
3490be94b7
commit
861234c349
@ -96,6 +96,7 @@ public:
|
|||||||
return (void *)StaticDeletedChain< Type >::allocate(size, get_type_handle(Type)); \
|
return (void *)StaticDeletedChain< Type >::allocate(size, get_type_handle(Type)); \
|
||||||
} \
|
} \
|
||||||
inline void *operator new(size_t size, void *ptr) { \
|
inline void *operator new(size_t size, void *ptr) { \
|
||||||
|
(void) size; \
|
||||||
return ptr; \
|
return ptr; \
|
||||||
} \
|
} \
|
||||||
inline void operator delete(void *ptr) { \
|
inline void operator delete(void *ptr) { \
|
||||||
@ -115,6 +116,7 @@ public:
|
|||||||
return (void *)_deleted_chain.allocate(size, get_type_handle(Type)); \
|
return (void *)_deleted_chain.allocate(size, get_type_handle(Type)); \
|
||||||
} \
|
} \
|
||||||
inline void *operator new(size_t size, void *ptr) { \
|
inline void *operator new(size_t size, void *ptr) { \
|
||||||
|
(void) size; \
|
||||||
return ptr; \
|
return ptr; \
|
||||||
} \
|
} \
|
||||||
inline void operator delete(void *ptr) { \
|
inline void operator delete(void *ptr) { \
|
||||||
|
@ -184,6 +184,9 @@
|
|||||||
|
|
||||||
#ifdef CPPPARSER
|
#ifdef CPPPARSER
|
||||||
#include <stdtypedefs.h>
|
#include <stdtypedefs.h>
|
||||||
|
|
||||||
|
// Also pick up the forward declaration of PyObject.
|
||||||
|
#include <Python.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_TAU
|
#ifdef USE_TAU
|
||||||
@ -322,14 +325,17 @@
|
|||||||
#define ALIGN_4BYTE
|
#define ALIGN_4BYTE
|
||||||
#define ALIGN_8BYTE
|
#define ALIGN_8BYTE
|
||||||
#define ALIGN_16BYTE
|
#define ALIGN_16BYTE
|
||||||
#elif defined(WIN32_VC)
|
#define ALIGN_64BYTE
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
#define ALIGN_4BYTE __declspec(align(4))
|
#define ALIGN_4BYTE __declspec(align(4))
|
||||||
#define ALIGN_8BYTE __declspec(align(8))
|
#define ALIGN_8BYTE __declspec(align(8))
|
||||||
#define ALIGN_16BYTE __declspec(align(16))
|
#define ALIGN_16BYTE __declspec(align(16))
|
||||||
|
#define ALIGN_64BYTE __declspec(align(64))
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#define ALIGN_4BYTE __attribute__ ((aligned (4)))
|
#define ALIGN_4BYTE __attribute__ ((aligned (4)))
|
||||||
#define ALIGN_8BYTE __attribute__ ((aligned (8)))
|
#define ALIGN_8BYTE __attribute__ ((aligned (8)))
|
||||||
#define ALIGN_16BYTE __attribute__ ((aligned (16)))
|
#define ALIGN_16BYTE __attribute__ ((aligned (16)))
|
||||||
|
#define ALIGN_64BYTE __attribute__ ((aligned (64)))
|
||||||
#else
|
#else
|
||||||
#define ALIGN_4BYTE
|
#define ALIGN_4BYTE
|
||||||
#define ALIGN_8BYTE
|
#define ALIGN_8BYTE
|
||||||
|
@ -28,24 +28,26 @@
|
|||||||
|
|
||||||
#define ALLOC_MEMORY_BASE \
|
#define ALLOC_MEMORY_BASE \
|
||||||
inline void *operator new(size_t size) { \
|
inline void *operator new(size_t size) { \
|
||||||
return PANDA_MALLOC_SINGLE(size); \
|
return PANDA_MALLOC_SINGLE(size); \
|
||||||
} \
|
} \
|
||||||
inline void *operator new(size_t size, void *ptr) { \
|
inline void *operator new(size_t size, void *ptr) { \
|
||||||
|
(void) size; \
|
||||||
return ptr; \
|
return ptr; \
|
||||||
} \
|
} \
|
||||||
inline void operator delete(void *ptr) { \
|
inline void operator delete(void *ptr) { \
|
||||||
PANDA_FREE_SINGLE(ptr); \
|
PANDA_FREE_SINGLE(ptr); \
|
||||||
} \
|
} \
|
||||||
inline void operator delete(void *ptr, void *) { \
|
inline void operator delete(void *, void *) { \
|
||||||
} \
|
} \
|
||||||
inline void *operator new[](size_t size) { \
|
inline void *operator new[](size_t size) { \
|
||||||
return PANDA_MALLOC_ARRAY(size); \
|
return PANDA_MALLOC_ARRAY(size); \
|
||||||
} \
|
} \
|
||||||
inline void *operator new[](size_t size, void *ptr) { \
|
inline void *operator new[](size_t size, void *ptr) { \
|
||||||
|
(void) size; \
|
||||||
return ptr; \
|
return ptr; \
|
||||||
} \
|
} \
|
||||||
inline void operator delete[](void *ptr) { \
|
inline void operator delete[](void *ptr) { \
|
||||||
PANDA_FREE_ARRAY(ptr); \
|
PANDA_FREE_ARRAY(ptr); \
|
||||||
} \
|
} \
|
||||||
inline void operator delete[](void *, void *) { \
|
inline void operator delete[](void *, void *) { \
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,10 @@
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef assert
|
||||||
|
// dlmalloc defines its own assert, which clashes.
|
||||||
|
#undef assert
|
||||||
|
#endif
|
||||||
#include "dlmalloc.h"
|
#include "dlmalloc.h"
|
||||||
#include "dlmalloc_src.cxx"
|
#include "dlmalloc_src.cxx"
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ public:
|
|||||||
// This pair of methods exists mainly for the convenience of
|
// This pair of methods exists mainly for the convenience of
|
||||||
// unambiguous upcasting. Interrogate generates code to call this
|
// unambiguous upcasting. Interrogate generates code to call this
|
||||||
// method instead of making an explicit cast to (TypedObject *);
|
// method instead of making an explicit cast to (TypedObject *);
|
||||||
// this allows classes who multiply inherit from TypedObejct to
|
// this allows classes who multiply inherit from TypedObject to
|
||||||
// override these methods and disambiguate the cast. It doesn't
|
// override these methods and disambiguate the cast. It doesn't
|
||||||
// have to be a virtual method, since this is just a static upcast.
|
// have to be a virtual method, since this is just a static upcast.
|
||||||
INLINE TypedObject *as_typed_object();
|
INLINE TypedObject *as_typed_object();
|
||||||
|
@ -35,6 +35,8 @@ void
|
|||||||
preprocess_argv(int &argc, char **&argv) {
|
preprocess_argv(int &argc, char **&argv) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
// Not Windows: do nothing.
|
// Not Windows: do nothing.
|
||||||
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
// Temporarily commenting out to fix build. Revisit shortly.
|
// Temporarily commenting out to fix build. Revisit shortly.
|
||||||
static Win32ArgParser parser;
|
static Win32ArgParser parser;
|
||||||
|
@ -127,6 +127,10 @@ private:
|
|||||||
// checking user input parameters, where optimal performance is not
|
// checking user input parameters, where optimal performance is not
|
||||||
// paramount.
|
// paramount.
|
||||||
|
|
||||||
|
// nassert_static() is a compile-time assertion. It should only be
|
||||||
|
// used with constant expressions and compilation will fail if the
|
||||||
|
// assertion is not true.
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
|
||||||
#define nassertr(condition, return_value)
|
#define nassertr(condition, return_value)
|
||||||
@ -190,6 +194,15 @@ private:
|
|||||||
|
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103 || (defined(__has_extension) && __has_extension(cxx_static_assert))
|
||||||
|
#define __nassert_static(condition, line, file) static_assert((condition), #condition " at line " #line " of " file)
|
||||||
|
#define _nassert_static(condition, line, file) __nassert_static(condition, line, file)
|
||||||
|
#define nassert_static(condition) _nassert_static(condition, __LINE__, __FILE__)
|
||||||
|
#else
|
||||||
|
#define __nassert_static(condition, suffix) typedef char nassert_static_ ## suffix [(condition) ? 1 : -1];
|
||||||
|
#define _nassert_static(condition, suffix) __nassert_static(condition, suffix)
|
||||||
|
#define nassert_static(condition) _nassert_static(condition, __COUNTER__)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "pnotify.I"
|
#include "pnotify.I"
|
||||||
|
|
||||||
|
@ -127,8 +127,10 @@ get() {
|
|||||||
INLINE OStreamWrapper::
|
INLINE OStreamWrapper::
|
||||||
OStreamWrapper(ostream *stream, bool owns_pointer, bool stringstream_hack) :
|
OStreamWrapper(ostream *stream, bool owns_pointer, bool stringstream_hack) :
|
||||||
_ostream(stream),
|
_ostream(stream),
|
||||||
_owns_pointer(owns_pointer),
|
_owns_pointer(owns_pointer)
|
||||||
_stringstream_hack(stringstream_hack)
|
#ifdef WIN32_VC
|
||||||
|
, _stringstream_hack(stringstream_hack)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,8 +142,10 @@ OStreamWrapper(ostream *stream, bool owns_pointer, bool stringstream_hack) :
|
|||||||
INLINE OStreamWrapper::
|
INLINE OStreamWrapper::
|
||||||
OStreamWrapper(ostream &stream) :
|
OStreamWrapper(ostream &stream) :
|
||||||
_ostream(&stream),
|
_ostream(&stream),
|
||||||
_owns_pointer(false),
|
_owns_pointer(false)
|
||||||
_stringstream_hack(false)
|
#ifdef WIN32_VC
|
||||||
|
, _stringstream_hack(false)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,9 @@ private:
|
|||||||
// this flag is set true, we know we have a possibly-empty
|
// this flag is set true, we know we have a possibly-empty
|
||||||
// stringstream, so we allow seekp(0) to fail silently, knowing that
|
// stringstream, so we allow seekp(0) to fail silently, knowing that
|
||||||
// there's no harm in this case.
|
// there's no harm in this case.
|
||||||
|
#ifdef WIN32_VC
|
||||||
bool _stringstream_hack;
|
bool _stringstream_hack;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -28,6 +28,7 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB int PyCFunction_New(...);
|
EXPCL_PYSTUB int PyCFunction_New(...);
|
||||||
EXPCL_PYSTUB int PyCFunction_NewEx(...);
|
EXPCL_PYSTUB int PyCFunction_NewEx(...);
|
||||||
EXPCL_PYSTUB int PyCallable_Check(...);
|
EXPCL_PYSTUB int PyCallable_Check(...);
|
||||||
|
EXPCL_PYSTUB int PyDict_DelItem(...);
|
||||||
EXPCL_PYSTUB int PyDict_DelItemString(...);
|
EXPCL_PYSTUB int PyDict_DelItemString(...);
|
||||||
EXPCL_PYSTUB int PyDict_GetItem(...);
|
EXPCL_PYSTUB int PyDict_GetItem(...);
|
||||||
EXPCL_PYSTUB int PyDict_GetItemString(...);
|
EXPCL_PYSTUB int PyDict_GetItemString(...);
|
||||||
@ -63,6 +64,7 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB int PyInt_AsLong(...);
|
EXPCL_PYSTUB int PyInt_AsLong(...);
|
||||||
EXPCL_PYSTUB int PyInt_AsSsize_t(...);
|
EXPCL_PYSTUB int PyInt_AsSsize_t(...);
|
||||||
EXPCL_PYSTUB int PyInt_FromLong(...);
|
EXPCL_PYSTUB int PyInt_FromLong(...);
|
||||||
|
EXPCL_PYSTUB int PyInt_FromSize_t(...);
|
||||||
EXPCL_PYSTUB int PyInt_Type(...);
|
EXPCL_PYSTUB int PyInt_Type(...);
|
||||||
EXPCL_PYSTUB int PyList_Append(...);
|
EXPCL_PYSTUB int PyList_Append(...);
|
||||||
EXPCL_PYSTUB int PyList_AsTuple(...);
|
EXPCL_PYSTUB int PyList_AsTuple(...);
|
||||||
@ -81,6 +83,7 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB int PyLong_FromUnsignedLongLong(...);
|
EXPCL_PYSTUB int PyLong_FromUnsignedLongLong(...);
|
||||||
EXPCL_PYSTUB int PyLong_Type(...);
|
EXPCL_PYSTUB int PyLong_Type(...);
|
||||||
EXPCL_PYSTUB int PyMapping_GetItemString(...);
|
EXPCL_PYSTUB int PyMapping_GetItemString(...);
|
||||||
|
EXPCL_PYSTUB int PyMem_Free(...);
|
||||||
EXPCL_PYSTUB int PyMemoryView_FromObject(...);
|
EXPCL_PYSTUB int PyMemoryView_FromObject(...);
|
||||||
EXPCL_PYSTUB int PyModule_AddIntConstant(...);
|
EXPCL_PYSTUB int PyModule_AddIntConstant(...);
|
||||||
EXPCL_PYSTUB int PyModule_AddObject(...);
|
EXPCL_PYSTUB int PyModule_AddObject(...);
|
||||||
@ -191,6 +194,8 @@ extern "C" {
|
|||||||
EXPCL_PYSTUB extern void *PyExc_ValueError;
|
EXPCL_PYSTUB extern void *PyExc_ValueError;
|
||||||
EXPCL_PYSTUB extern void *_Py_NoneStruct;
|
EXPCL_PYSTUB extern void *_Py_NoneStruct;
|
||||||
EXPCL_PYSTUB extern void *_Py_NotImplementedStruct;
|
EXPCL_PYSTUB extern void *_Py_NotImplementedStruct;
|
||||||
|
EXPCL_PYSTUB extern void *_Py_TrueStruct;
|
||||||
|
EXPCL_PYSTUB extern void *_Py_ZeroStruct;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -207,6 +212,7 @@ int PyBytes_Size(...) { return 0; }
|
|||||||
int PyCFunction_New(...) { return 0; };
|
int PyCFunction_New(...) { return 0; };
|
||||||
int PyCFunction_NewEx(...) { return 0; };
|
int PyCFunction_NewEx(...) { return 0; };
|
||||||
int PyCallable_Check(...) { return 0; }
|
int PyCallable_Check(...) { return 0; }
|
||||||
|
int PyDict_DelItem(...) { return 0; }
|
||||||
int PyDict_DelItemString(...) { return 0; }
|
int PyDict_DelItemString(...) { return 0; }
|
||||||
int PyDict_GetItem(...) { return 0; }
|
int PyDict_GetItem(...) { return 0; }
|
||||||
int PyDict_GetItemString(...) { return 0; }
|
int PyDict_GetItemString(...) { return 0; }
|
||||||
@ -242,6 +248,7 @@ int PyImport_GetModuleDict(...) { return 0; }
|
|||||||
int PyInt_AsLong(...) { return 0; }
|
int PyInt_AsLong(...) { return 0; }
|
||||||
int PyInt_AsSsize_t(...) { return 0; }
|
int PyInt_AsSsize_t(...) { return 0; }
|
||||||
int PyInt_FromLong(...) { return 0; }
|
int PyInt_FromLong(...) { return 0; }
|
||||||
|
int PyInt_FromSize_t(...) { return 0; }
|
||||||
int PyInt_Type(...) { return 0; }
|
int PyInt_Type(...) { return 0; }
|
||||||
int PyList_Append(...) { return 0; }
|
int PyList_Append(...) { return 0; }
|
||||||
int PyList_AsTuple(...) { return 0; }
|
int PyList_AsTuple(...) { return 0; }
|
||||||
@ -260,6 +267,7 @@ int PyLong_FromUnsignedLong(...) { return 0; }
|
|||||||
int PyLong_FromUnsignedLongLong(...) { return 0; }
|
int PyLong_FromUnsignedLongLong(...) { return 0; }
|
||||||
int PyLong_Type(...) { return 0; }
|
int PyLong_Type(...) { return 0; }
|
||||||
int PyMapping_GetItemString(...) { return 0; }
|
int PyMapping_GetItemString(...) { return 0; }
|
||||||
|
int PyMem_Free(...) { return 0; }
|
||||||
int PyMemoryView_FromObject(...) { return 0; }
|
int PyMemoryView_FromObject(...) { return 0; }
|
||||||
int PyModule_AddIntConstant(...) { return 0; };
|
int PyModule_AddIntConstant(...) { return 0; };
|
||||||
int PyModule_AddObject(...) { return 0; };
|
int PyModule_AddObject(...) { return 0; };
|
||||||
@ -375,6 +383,8 @@ void *PyExc_TypeError = (void *)NULL;
|
|||||||
void *PyExc_ValueError = (void *)NULL;
|
void *PyExc_ValueError = (void *)NULL;
|
||||||
void *_Py_NoneStruct = (void *)NULL;
|
void *_Py_NoneStruct = (void *)NULL;
|
||||||
void *_Py_NotImplementedStruct = (void *)NULL;
|
void *_Py_NotImplementedStruct = (void *)NULL;
|
||||||
|
void *_Py_TrueStruct = (void *)NULL;
|
||||||
|
void *_Py_ZeroStruct = (void *)NULL;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user