| 101 | } |
| 102 | |
| 103 | void Foundation::errorImpl(PxErrorCode::Enum e, const char* file, int line, const char* messageFmt, va_list va) |
| 104 | { |
| 105 | PX_ASSERT(messageFmt); |
| 106 | if(e & mErrorMask) |
| 107 | { |
| 108 | // this function is reentrant but user's error callback may not be, so... |
| 109 | Mutex::ScopedLock lock(mErrorMutex); |
| 110 | |
| 111 | // using a static fixed size buffer here because: |
| 112 | // 1. vsnprintf return values differ between platforms |
| 113 | // 2. va_start is only usable in functions with ellipses |
| 114 | // 3. ellipses (...) cannot be passed to called function |
| 115 | // which would be necessary to dynamically grow the buffer here |
| 116 | |
| 117 | static const size_t bufSize = 1024; |
| 118 | char stringBuffer[bufSize]; |
| 119 | shdfnd::vsnprintf(stringBuffer, bufSize, messageFmt, va); |
| 120 | |
| 121 | mBroadcastingError.reportError(e, stringBuffer, file, line); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | Foundation* Foundation::createInstance(PxU32 version, PxErrorCallback& errc, PxAllocatorCallback& alloc) |
| 126 | { |
no test coverage detected