NVIDIAGameWorks / PhysX-3.4

NVIDIA PhysX SDK 3.4
https://www.nvidia.com/
2.35k stars 273 forks source link

physx::shdfnd::aos namespace for <arm_neon.h> #77

Closed GregSlazinski closed 5 years ago

GregSlazinski commented 5 years ago

PsVecMath.h defines namespaces

namespace physx
{
namespace shdfnd
{
namespace aos
{

here: https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PxShared/src/foundation/include/PsVecMath.h#L74 and then includes "PsAoS.h" https://github.com/NVIDIAGameWorks/PhysX-3.4/blob/master/PxShared/src/foundation/include/PsVecMath.h#L94 which may include

include "unix/PsUnixAoS.h"

which may include

include "neon/PsUnixNeonAoS.h"

which may include

include

Which on Android NDK looks like this:

#ifndef __ARM_NEON_H
#define __ARM_NEON_H 
..
typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
..
#endif /* __ARM_NEON_H */

So we get something like

namespace physx
{
namespace shdfnd
{
namespace aos
{
#include <arm_neon.h>
..

so the actual 'float32x4_t' which should be defined in global namespace as ::float32x4_t gets defined as ::physx::shdfnd::aos::float32x4_t

which causes build errors in my software.

PhysX should NOT include the "#include " within a namespace, but outside of it.

AlesBorovicka commented 5 years ago

Hi, you are right, we will try to fix it. Sorry for the trouble. Regards, Ales