| 327 | } |
| 328 | |
| 329 | void bf::System::Runtime::Init(int version, int flags, BfRtCallbacks* callbacks) |
| 330 | { |
| 331 | BfpSystemInitFlags sysInitFlags = BfpSystemInitFlag_InstallCrashCatcher; |
| 332 | if ((flags & 4) != 0) |
| 333 | sysInitFlags = (BfpSystemInitFlags)(sysInitFlags | BfpSystemInitFlag_SilentCrash); |
| 334 | BfpSystem_Init(BFP_VERSION, sysInitFlags); |
| 335 | |
| 336 | if (gBfRtCallbacks.Alloc != NULL) |
| 337 | { |
| 338 | Internal_FatalError("BeefRT already initialized. Multiple executable modules in the same process cannot dynamically link to the Beef runtime."); |
| 339 | } |
| 340 | |
| 341 | if (version != BFRT_VERSION) |
| 342 | { |
| 343 | char error[256]; |
| 344 | sprintf(error, "BeefRT build version '%d' does not match requested version '%d'", BFRT_VERSION, version); |
| 345 | BfpSystem_FatalError(error, "BEEF FATAL ERROR"); |
| 346 | } |
| 347 | |
| 348 | gBfRtCallbacks = *callbacks; |
| 349 | gBfRtFlags = (BfRtFlags)flags; |
| 350 | |
| 351 | #ifdef BF_PLATFORM_WINDOWS |
| 352 | gBfTLSKey = FlsAlloc(TlsFreeFunc); |
| 353 | #else |
| 354 | pthread_key_create(&gBfTLSKey, TlsFreeFunc); |
| 355 | #endif |
| 356 | } |
| 357 | |
| 358 | void bf::System::Runtime::InitCrashCatcher(int flags) |
| 359 | { |
nothing calls this directly
no test coverage detected