| 259 | static const char* volatile gErrorString = NULL; |
| 260 | |
| 261 | void SetErrorString(const char* str) |
| 262 | { |
| 263 | char* newStr = strdup(str); |
| 264 | while (true) |
| 265 | { |
| 266 | const char* prevStr = gErrorString; |
| 267 | auto result = (void*)BfpSystem_InterlockedCompareExchangePtr((uintptr*)&gErrorString, (uintptr)prevStr, (uintptr)newStr); |
| 268 | if (result != prevStr) |
| 269 | continue; |
| 270 | if (prevStr != NULL) |
| 271 | free((void*)prevStr); |
| 272 | break; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | #define SETUP_ERROR(str, skip) SetErrorString(str); gBfRtCallbacks.DebugMessageData_SetupError(str, skip) |
| 277 |
no test coverage detected