Last change
on this file since 367 was 337, checked in by coas-nagasima, 6 years ago |
ASP3版ECNLを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
731 bytes
|
Line | |
---|
1 | #include "stdio_impl.h"
|
---|
2 |
|
---|
3 | #ifndef __c2__
|
---|
4 | static FILE *volatile dummy_file = 0;
|
---|
5 | weak_alias(dummy_file, __stdin_used);
|
---|
6 | weak_alias(dummy_file, __stdout_used);
|
---|
7 | weak_alias(dummy_file, __stderr_used);
|
---|
8 | #else
|
---|
9 | extern FILE *volatile __stdin_used;
|
---|
10 | extern FILE *volatile __stdout_used;
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | static void close_file(FILE *f)
|
---|
14 | {
|
---|
15 | if (!f) return;
|
---|
16 | FFINALLOCK(f);
|
---|
17 | if (f->wpos > f->wbase) f->write(f, 0, 0);
|
---|
18 | if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
|
---|
19 | }
|
---|
20 |
|
---|
21 | void __stdio_exit(void)
|
---|
22 | {
|
---|
23 | FILE *f;
|
---|
24 | for (f=*__ofl_lock(); f; f=f->next) close_file(f);
|
---|
25 | close_file(__stdin_used);
|
---|
26 | close_file(__stdout_used);
|
---|
27 | }
|
---|
28 |
|
---|
29 | #ifndef __c2__
|
---|
30 | weak_alias(__stdio_exit, __stdio_exit_needed);
|
---|
31 | #else
|
---|
32 | void __stdio_exit_needed(void)
|
---|
33 | {
|
---|
34 | __stdio_exit();
|
---|
35 | }
|
---|
36 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.