projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1
[oweals/musl.git]
/
src
/
stdio
/
fwide.c
1
#include <wchar.h>
2
#include "stdio_impl.h"
3
4
#define SH (8*sizeof(int)-1)
5
#define NORMALIZE(x) ((x)>>SH | -((-(x))>>SH))
6
7
int fwide(FILE *f, int mode)
8
{
9
FLOCK(f);
10
if (!f->mode) f->mode = NORMALIZE(mode);
11
mode = f->mode;
12
FUNLOCK(f);
13
return mode;
14
}