MCPcopy Create free account
hub / github.com/MikeMirzayanov/testlib / __testlib_set_binary

Function __testlib_set_binary

testlib.h:518–562  ·  view source on GitHub ↗

It does nothing on non-windows and files differ from stdin/stdout/stderr. */

Source from the content-addressed store, hash-verified

516
517/** It does nothing on non-windows and files differ from stdin/stdout/stderr. */
518static void __testlib_set_binary(std::FILE *file) {
519 if (NULL != file) {
520#ifdef ON_WINDOWS
521# ifdef _O_BINARY
522 if (stdin == file)
523# ifdef STDIN_FILENO
524 return void(_setmode(STDIN_FILENO, _O_BINARY));
525# else
526 return void(_setmode(_fileno(stdin), _O_BINARY));
527# endif
528 if (stdout == file)
529# ifdef STDOUT_FILENO
530 return void(_setmode(STDOUT_FILENO, _O_BINARY));
531# else
532 return void(_setmode(_fileno(stdout), _O_BINARY));
533# endif
534 if (stderr == file)
535# ifdef STDERR_FILENO
536 return void(_setmode(STDERR_FILENO, _O_BINARY));
537# else
538 return void(_setmode(_fileno(stderr), _O_BINARY));
539# endif
540# elif O_BINARY
541 if (stdin == file)
542# ifdef STDIN_FILENO
543 return void(setmode(STDIN_FILENO, O_BINARY));
544# else
545 return void(setmode(fileno(stdin), O_BINARY));
546# endif
547 if (stdout == file)
548# ifdef STDOUT_FILENO
549 return void(setmode(STDOUT_FILENO, O_BINARY));
550# else
551 return void(setmode(fileno(stdout), O_BINARY));
552# endif
553 if (stderr == file)
554# ifdef STDERR_FILENO
555 return void(setmode(STDERR_FILENO, O_BINARY));
556# else
557 return void(setmode(fileno(stderr), O_BINARY));
558# endif
559# endif
560#endif
561 }
562}
563
564#if __cplusplus > 199711L || defined(_MSC_VER)
565template<typename T>

Callers 6

testlib.hFile · 0.70
registerGenFunction · 0.70
registerInteractionFunction · 0.70
registerValidationFunction · 0.70
registerTestlibCmdFunction · 0.70
registerScorerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected