Use fgetc directly under msvc in richio

getc is a real function instead of macro like under gcc implementations. This adds a tiny cost of calls.
This commit is contained in:
Marek Roszko 2022-08-13 21:56:50 -04:00 committed by Mark Roszko
parent fd6564cc82
commit 90a62d8b02
1 changed files with 5 additions and 0 deletions

View File

@ -36,8 +36,13 @@
// Fall back to getc() when getc_unlocked() is not available on the target platform. // Fall back to getc() when getc_unlocked() is not available on the target platform.
#if !defined( HAVE_FGETC_NOLOCK ) #if !defined( HAVE_FGETC_NOLOCK )
#ifdef _MSC_VER
//getc is not a macro on windows and adds a tiny overhead for the indirection to eventually calling fgetc
#define getc_unlocked fgetc
#else
#define getc_unlocked getc #define getc_unlocked getc
#endif #endif
#endif
static int vprint( std::string* result, const char* format, va_list ap ) static int vprint( std::string* result, const char* format, va_list ap )