From f6b66fc5dbe1dcedd6cd818a45555438ad2d5975 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 25 Nov 2015 02:01:07 +0100 Subject: [PATCH] Fix PhysX compile issues on Mac --- dtool/src/parser-inc/stdtypedefs.h | 2 -- makepanda/makepanda.py | 2 ++ panda/src/physx/physxActorDesc.cxx | 3 +-- panda/src/physx/physxController.cxx | 2 ++ panda/src/physx/physxForceField.cxx | 2 +- panda/src/physx/physxKitchen.cxx | 8 ++++---- panda/src/physx/physxScene.cxx | 2 +- panda/src/physx/physxSceneDesc.cxx | 3 +-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dtool/src/parser-inc/stdtypedefs.h b/dtool/src/parser-inc/stdtypedefs.h index 56d95508f7..47f7d50399 100644 --- a/dtool/src/parser-inc/stdtypedefs.h +++ b/dtool/src/parser-inc/stdtypedefs.h @@ -19,7 +19,6 @@ #ifndef STDTYPEDEFS_H #define STDTYPEDEFS_H -#ifndef __APPLE__ typedef unsigned int size_t; typedef int ssize_t; typedef int off_t; @@ -30,7 +29,6 @@ struct FILE; namespace std { } -#endif typedef int ptrdiff_t; typedef unsigned int uint; diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index f53a6a75ba..e3d4477ab8 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1360,6 +1360,8 @@ def CompileIgate(woutd,wsrc,opts): cmd += ' -D_LP64' else: cmd += ' -D__i386__' + if GetTarget() == 'darwin': + cmd += ' -D__APPLE__' optlevel = GetOptimizeOption(opts) if (optlevel==1): cmd += ' -D_DEBUG' diff --git a/panda/src/physx/physxActorDesc.cxx b/panda/src/physx/physxActorDesc.cxx index 326bcabb58..daf6f49ee0 100644 --- a/panda/src/physx/physxActorDesc.cxx +++ b/panda/src/physx/physxActorDesc.cxx @@ -117,8 +117,7 @@ set_body(PhysxBodyDesc &desc) { //////////////////////////////////////////////////////////////////// PhysxBodyDesc PhysxActorDesc:: get_body() const { - - throw "Not Implemented"; + assert(false /* Not implemented */); //PhysxBodyDesc value; //value._desc = *(_desc.body); diff --git a/panda/src/physx/physxController.cxx b/panda/src/physx/physxController.cxx index 089983e817..59125f3ff8 100644 --- a/panda/src/physx/physxController.cxx +++ b/panda/src/physx/physxController.cxx @@ -55,6 +55,8 @@ factory(NxControllerType controllerType) { case NX_CONTROLLER_CAPSULE: return new PhysxCapsuleController(); + default: + break; } physx_cat.error() << "Unknown controller type.\n"; diff --git a/panda/src/physx/physxForceField.cxx b/panda/src/physx/physxForceField.cxx index 44ccbe5859..67fcd1d033 100644 --- a/panda/src/physx/physxForceField.cxx +++ b/panda/src/physx/physxForceField.cxx @@ -135,7 +135,7 @@ get_include_shape_group() const { unsigned int PhysxForceField:: get_num_shape_groups() const { - nassertr(_error_type == ET_ok, NULL); + nassertr(_error_type == ET_ok, 0); return _ptr->getNbShapeGroups(); } diff --git a/panda/src/physx/physxKitchen.cxx b/panda/src/physx/physxKitchen.cxx index 883a52911f..b844c8b8d0 100644 --- a/panda/src/physx/physxKitchen.cxx +++ b/panda/src/physx/physxKitchen.cxx @@ -170,7 +170,7 @@ cook_texcoords(const PhysxClothMeshDesc &meshDesc, const Filename &filename) { PhysxConvexMesh *PhysxKitchen:: cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc) { - nassertr_always(meshDesc.is_valid(), false); + nassertr_always(meshDesc.is_valid(), NULL); PhysxMemoryWriteBuffer buffer; bool status = _cooking->NxCookConvexMesh(meshDesc.get_desc(), buffer); @@ -198,7 +198,7 @@ cook_convex_mesh(const PhysxConvexMeshDesc &meshDesc) { PhysxTriangleMesh *PhysxKitchen:: cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc) { - nassertr_always(meshDesc.is_valid(), false); + nassertr_always(meshDesc.is_valid(), NULL); PhysxMemoryWriteBuffer buffer; bool status = _cooking->NxCookTriangleMesh(meshDesc.get_desc(), buffer); @@ -226,7 +226,7 @@ cook_triangle_mesh(const PhysxTriangleMeshDesc &meshDesc) { PhysxClothMesh *PhysxKitchen:: cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc) { - nassertr_always(meshDesc.is_valid(), false); + nassertr_always(meshDesc.is_valid(), NULL); PhysxMemoryWriteBuffer wbuffer; bool status = _cooking->NxCookClothMesh(meshDesc.get_desc(), wbuffer); @@ -255,7 +255,7 @@ cook_cloth_mesh(const PhysxClothMeshDesc &meshDesc) { PhysxSoftBodyMesh *PhysxKitchen:: cook_soft_body_mesh(const PhysxSoftBodyMeshDesc &meshDesc) { - nassertr_always(meshDesc.is_valid(), false); + nassertr_always(meshDesc.is_valid(), NULL); PhysxMemoryWriteBuffer wbuffer; bool status = _cooking->NxCookSoftBodyMesh(meshDesc.get_desc(), wbuffer); diff --git a/panda/src/physx/physxScene.cxx b/panda/src/physx/physxScene.cxx index a8c4a22b20..5462de9739 100644 --- a/panda/src/physx/physxScene.cxx +++ b/panda/src/physx/physxScene.cxx @@ -309,7 +309,7 @@ void PhysxScene:: set_timing_variable() { nassertv(_error_type == ET_ok); - _ptr->setTiming(NULL, NULL, NX_TIMESTEP_VARIABLE); + _ptr->setTiming(0, 0, NX_TIMESTEP_VARIABLE); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/physx/physxSceneDesc.cxx b/panda/src/physx/physxSceneDesc.cxx index 48bd47a703..163774ce31 100644 --- a/panda/src/physx/physxSceneDesc.cxx +++ b/panda/src/physx/physxSceneDesc.cxx @@ -97,8 +97,7 @@ set_max_bounds(PhysxBounds3 &bounds) { //////////////////////////////////////////////////////////////////// PhysxBounds3 PhysxSceneDesc:: get_max_bounds() const { - - throw "Not Implemented"; + assert(false /* Not implemented */); //PhysxBounds3 value; //value._bounds = *(_desc.maxBounds);