Debian Codegraph @

test cases/windows/26 global crt value/test.c

raw
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <io.h>
4 #include <crtdbg.h>
5
6 __declspec (dllimport)
7 int
8 liba_get_fd (void);
9
10 int
11 main (void)
12 {
13 int fd_stderr = _fileno (stderr);
14 if (fd_stderr >= 0)
15 {
16 _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE);
17 _CrtSetReportFile (_CRT_ASSERT, (_HFILE)_get_osfhandle (fd_stderr));
18 }
19
20 int ret = _close (liba_get_fd ());
21 if (ret != 0)
22 return EXIT_FAILURE;
23
24 return EXIT_SUCCESS;
25 }