forked from chikuzen/MPEG2DecPlus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwin_import_min.h
38 lines (28 loc) · 1.28 KB
/
win_import_min.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef WIN_IMPORT_MIN_H
#define WIN_IMPORT_MIN_H
/* support from recent _mingw.h */
#ifdef __cplusplus
#define __forceinline inline __attribute__((__always_inline__))
#else
#define __forceinline extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
#endif /* __cplusplus */
#ifdef __GNUC__
#define _byteswap_ulong(x) __builtin_bswap32(x)
#endif
#define _read read
#define _lseeki64 lseek
#define _close close
/* gnu libc offers the equivalent 'aligned_alloc' BUT requested 'size'
has to be a multiple of 'alignment' - in case it isn't, I'll set
a different size, rounding up the value */
#define _aligned_malloc(s,a) ( \
aligned_alloc(a,((s-1)/a+1)*a) \
)
#define _aligned_free(x) free(x)
#define _atoi64(x) strtoll(x,NULL,10)
#define sprintf_s(buf,...) snprintf((buf),sizeof(buf),__VA_ARGS__)
#define strncpy_s(d,n,s,c) strncpy(d,s,c)
#define vsprintf_s(d,n,t,v) vsprintf(d,t,v)
#define sscanf_s(buf,...) sscanf((buf),__VA_ARGS__)
#define fscanf_s(f,t,...) fscanf(f,t,__VA_ARGS__)
#endif // WIN_IMPORT_MIN_H