[453] | 1 | // Copyright (c) Microsoft. All rights reserved.
|
---|
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
---|
| 3 |
|
---|
| 4 | /*depending if the symbol GB_STDIO_INTERCEPT is defined, this file does the following
|
---|
| 5 |
|
---|
| 6 | a) if GB_STDIO_INTERCEPT is NOT defined, then the file shall be empty (almost:)
|
---|
| 7 | b) if GB_STDIO_INTERCEPT is defined, then the file shall call to the 'real' stdio.h functions from their gb_* synonyms*/
|
---|
| 8 | #ifdef _MSC_VER
|
---|
| 9 | /* compiler warning C4206: nonstandard extension used: translation unit is empty */
|
---|
| 10 | /* linker warning 4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library */
|
---|
| 11 | const int avoid_warnings_B9EB480E_6AE7_43B3_9249_47993776BA7B = 0;
|
---|
| 12 | #endif
|
---|
| 13 | #ifdef GB_STDIO_INTERCEPT
|
---|
| 14 |
|
---|
| 15 | #ifdef __cplusplus
|
---|
| 16 | #include <cstdio>
|
---|
| 17 | #include <cstdarg>
|
---|
| 18 | #else
|
---|
| 19 | #include <stdio.h>
|
---|
| 20 | #include <stdarg.h>
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 | #include "azure_c_shared_utility/gb_stdio.h"
|
---|
| 24 |
|
---|
| 25 | /*this is fopen*/
|
---|
| 26 | FILE *gb_fopen(const char * filename, const char * mode)
|
---|
| 27 | {
|
---|
| 28 | return fopen(filename, mode);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | int gb_fclose(FILE *stream)
|
---|
| 32 | {
|
---|
| 33 | return fclose(stream);
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | int gb_fseek(FILE *stream, long int offset, int whence)
|
---|
| 37 | {
|
---|
| 38 | return fseek(stream, offset, whence);
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | long int gb_ftell(FILE *stream)
|
---|
| 42 | {
|
---|
| 43 | return ftell(stream);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | int fprintf(FILE * stream, const char * format, ...)
|
---|
| 47 | {
|
---|
| 48 | va_list args;
|
---|
| 49 | va_start(args, format);
|
---|
| 50 | vfprintf(stream, format, args);
|
---|
| 51 | va_end(args);
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|