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