|
58 | 58 | # endif
|
59 | 59 | #elif defined(LIBPLZMA_MSC)
|
60 | 60 | // Defined as 1 if the /GR (Enable Run-Time Type Information) compiler option is set. Otherwise, undefined.
|
| 61 | +// When /GR is on, the compiler defines the _CPPRTTI preprocessor macro. |
| 62 | +// By default, /GR is on. /GR- disables run-time type information. |
| 63 | +// However, /GR increases the size of the .rdata sections of your image. |
| 64 | +// If your code does not use dynamic_cast or typeid, /GR- may produce a smaller image. |
| 65 | +// https://learn.microsoft.com/en-us/cpp/build/reference/gr-enable-run-time-type-information |
61 | 66 | # if (defined(_CPPRTTI) && (_CPPRTTI > 0))
|
62 | 67 | # define RTTI_ENABLED 1
|
63 | 68 | # endif
|
64 | 69 | #endif
|
65 | 70 |
|
| 71 | +#if defined(RTTI_ENABLED) && defined(LIBPLZMA_NO_CPP_RTTI) |
| 72 | +# error "CMake rtti configuration error." |
| 73 | +#endif |
| 74 | + |
66 | 75 | plzma_path_timestamp plzma_path_timestamp_now(void) {
|
67 | 76 | plzma_path_timestamp t;
|
68 | 77 | t.last_access = t.last_modification = t.creation = ::time(NULL);
|
@@ -666,30 +675,30 @@ void plzma_item_out_stream_array_release(plzma_item_out_stream_array * LIBPLZMA_
|
666 | 675 |
|
667 | 676 | #if 0
|
668 | 677 | void plzma_print_memory(int line, const void * LIBPLZMA_NULLABLE mem, const size_t len) {
|
669 |
| - fprintf(stdout, "PRINT MEMORY AT LINE: %i, LEN: %llu\n", line, (unsigned long long)len); |
| 678 | + ::fprintf(stdout, "PRINT MEMORY AT LINE: %i, LEN: %llu\n", line, (unsigned long long)len); |
670 | 679 | if (!mem) {
|
671 |
| - fprintf(stdout, "NULL\n"); |
672 |
| - fflush(stdout); |
| 680 | + ::fprintf(stdout, "NULL\n"); |
| 681 | + ::fflush(stdout); |
673 | 682 | return;
|
674 | 683 | }
|
675 | 684 | char buff[256];
|
676 | 685 | char * s = buff;
|
677 | 686 | const uint8_t * umem = reinterpret_cast<const uint8_t *>(mem);
|
678 | 687 | bool hasoutput = false;
|
679 | 688 | for (size_t i = 0, j = 0; i < len; i++, j++) {
|
680 |
| - int sp = sprintf(s, "0x%02x ", umem[i]); |
| 689 | + int sp = ::sprintf(s, "0x%02x ", umem[i]); |
681 | 690 | s += sp;
|
682 | 691 | hasoutput = true;
|
683 | 692 | if (j == 10) {
|
684 |
| - fprintf(stdout, "%s\n", buff); |
| 693 | + ::fprintf(stdout, "%s\n", buff); |
685 | 694 | j = 0;
|
686 | 695 | s = buff;
|
687 | 696 | hasoutput = false;
|
688 | 697 | }
|
689 | 698 | }
|
690 | 699 | if (hasoutput) {
|
691 |
| - fprintf(stdout, "%s\n", buff); |
| 700 | + ::fprintf(stdout, "%s\n", buff); |
692 | 701 | }
|
693 |
| - fflush(stdout); |
| 702 | + ::fflush(stdout); |
694 | 703 | }
|
695 | 704 | #endif // #if 0
|
0 commit comments