| 564 | } |
| 565 | |
| 566 | int hb_platform_init() |
| 567 | { |
| 568 | int result = 0; |
| 569 | |
| 570 | #if defined(SYS_MINGW) && defined(PTW32_VERSION) |
| 571 | result = !pthread_win32_process_attach_np(); |
| 572 | if (result) |
| 573 | { |
| 574 | hb_error("pthread_win32_process_attach_np() failed!"); |
| 575 | return -1; |
| 576 | } |
| 577 | #endif |
| 578 | |
| 579 | #if defined(_WIN32) || defined(__MINGW32__) |
| 580 | /* |
| 581 | * win32 _IOLBF (line-buffering) is the same as _IOFBF (full-buffering). |
| 582 | * force it to unbuffered otherwise informative output is not easily parsed. |
| 583 | */ |
| 584 | result = setvbuf(stdout, NULL, _IONBF, 0); |
| 585 | if (result) |
| 586 | { |
| 587 | hb_error("setvbuf(stdout, NULL, _IONBF, 0) failed!"); |
| 588 | return -1; |
| 589 | } |
| 590 | result = setvbuf(stderr, NULL, _IONBF, 0); |
| 591 | if (result) |
| 592 | { |
| 593 | hb_error("setvbuf(stderr, NULL, _IONBF, 0) failed!"); |
| 594 | return -1; |
| 595 | } |
| 596 | #endif |
| 597 | |
| 598 | init_cpu_info(); |
| 599 | |
| 600 | return result; |
| 601 | } |
| 602 | |
| 603 | /************************************************************************ |
| 604 | * Get app data config directory |
no test coverage detected