Changed the macros in the msvcrt headers to static inline functions.

This commit is contained in:
Madhura Sahasrabudhe 2003-03-22 21:15:41 +00:00 committed by Alexandre Julliard
parent 3dc1f2dff3
commit 992d1b998a
9 changed files with 74 additions and 74 deletions

View File

@ -39,20 +39,20 @@ unsigned short _outpw(unsigned short, unsigned short);
#ifndef USE_MSVCRT_PREFIX
#define cgets _cgets
static inline char* cgets(char* str) { return _cgets(str); }
#define cprintf _cprintf
#define cputs _cputs
static inline int cputs(const char* str) { return _cputs(str); }
#define cscanf _cscanf
#define getch _getch
#define getche _getche
#define kbhit _kbhit
#define putch _putch
#define ungetch _ungetch
static inline int getch(void) { return _getch(); }
static inline int getche(void) { return _getche(); }
static inline int kbhit(void) { return _kbhit(); }
static inline int putch(int c) { return _putch(c); }
static inline int ungetch(int c) { return _ungetch(c); }
#ifdef _M_IX86
#define inp _inp
#define inpw _inpw
#define outp _outp
#define outpw _outpw
static inline int inp(unsigned short i) { return _inp(i); }
static inline unsigned short inpw(unsigned short i) { return _inpw(i); }
static inline int outp(unsigned short i, int j) { return _outp(i, j); }
static inline unsigned short outpw(unsigned short i, unsigned short j) { return _outpw(i, j); }
#endif
#endif /* USE_MSVCRT_PREFIX */

View File

@ -104,10 +104,10 @@ MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
#ifndef USE_MSVCRT_PREFIX
#define isascii __isascii
#define iscsym __iscsym
#define iscsymf __iscsymf
#define toascii __toascii
static inline int isascii(int c) { return __isascii(c); }
static inline int iscsym(int c) { return __iscsym(c); }
static inline int iscsymf(int c) { return __iscsymf(c); }
static inline int toascii(int c) { return __toascii(c); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_CTYPE_H */

View File

@ -67,10 +67,10 @@ int _wrmdir(const MSVCRT(wchar_t)*);
#ifndef USE_MSVCRT_PREFIX
#define chdir _chdir
#define getcwd _getcwd
#define mkdir _mkdir
#define rmdir _rmdir
static inline int chdir(const char* newdir) { return _chdir(newdir); }
static inline char* getcwd(char * buf, int size) { return _getcwd(buf, size); }
static inline int mkdir(const char* newdir) { return _mkdir(newdir); }
static inline int rmdir(const char* dir) { return _rmdir(dir); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_DIRECT_H */

View File

@ -81,7 +81,7 @@ void* MSVCRT(realloc)(void*,MSVCRT(size_t));
#ifndef USE_MSVCRT_PREFIX
#define alloca _alloca
static inline void* alloca(MSVCRT(size_t) i) { return _alloca(i); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_MALLOC_H */

View File

@ -121,24 +121,24 @@ int _wsystem(const MSVCRT(wchar_t)*);
#define WAIT_CHILD _WAIT_CHILD
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
#define cwait _cwait
#define getpid _getpid
static inline int cwait(int *status, int pid, int action) { return _cwait(status, pid, action); }
static inline int getpid(void) { return _getpid(); }
#define execl _execl
#define execle _execle
#define execlp _execlp
#define execlpe _execlpe
#define execv _execv
#define execve _execve
#define execvp _execvp
#define execvpe _execvpe
static inline int execv(const char* name, char* const* argv) { return _execv(name, argv); }
static inline int execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); }
static inline int execvp(const char* name, char* const* argv) { return _execvp(name, argv); }
static inline int execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); }
#define spawnl _spawnl
#define spawnle _spawnle
#define spawnlp _spawnlp
#define spawnlpe _spawnlpe
#define spawnv _spawnv
#define spawnve _spawnve
#define spawnvp _spawnvp
#define spawnvpe _spawnvpe
static inline int spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); }
static inline int spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); }
static inline int spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); }
static inline int spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_PROCESS_H */

View File

@ -54,8 +54,8 @@ void MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
#ifndef USE_MSVCRT_PREFIX
#define lfind _lfind
#define lsearch _lsearch
static inline void* lfind(const void* match, const void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*)) { return _lfind(match, start, array_size, elem_size, cf);
static inline void* lsearch(const void* match, void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*) ) { return _lsearch(match, start, array_size, elem_size, cf); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_SEARCH_H */

View File

@ -256,22 +256,22 @@ int MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
#ifndef USE_MSVCRT_PREFIX
#define fdopen _fdopen
#define fgetchar _fgetchar
#define fileno _fileno
#define fputchar _fputchar
#define pclose _pclose
#define popen _popen
#define tempnam _tempnam
static inline MSVCRT(FILE)* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
static inline int fgetchar(void) { return _fgetchar(); }
static inline int fileno(MSVCRT(FILE)* file) { return _fileno(file); }
static inline int fputchar(int c) { return _fputchar(c); }
static inline int pclose(MSVCRT(FILE)* file) { return _pclose(file); }
static inline MSVCRT(FILE)* popen(const char* command, const char* mode) { return _popen(command, mode); }
static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
#ifndef MSVCRT_UNLINK_DEFINED
static inline int unlink(const char* path) { return _unlink(path); }
#define MSVCRT_UNLINK_DEFINED
#endif
#define fgetwchar _fgetwchar
#define fputwchar _fputwchar
#define getw _getw
#define putw _putw
static inline MSVCRT(wint_t) fgetwchar(void) { return _fgetwchar(); }
static inline MSVCRT(wint_t) fputwchar(MSVCRT(wint_t) wc) { return _fputwchar(wc); }
static inline int getw(MSVCRT(FILE)* file) { return _getw(file); }
static inline int putw(int val, MSVCRT(FILE)* file) { return _putw(val, file); }
#define wpopen _wpopen
#endif /* USE_MSVCRT_PREFIX */

View File

@ -231,15 +231,15 @@ int MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
#define environ _environ
#define onexit_t _onexit_t
#define ecvt _ecvt
#define fcvt _fcvt
#define gcvt _gcvt
#define itoa _itoa
#define ltoa _ltoa
#define onexit _onexit
#define putenv _putenv
#define swab _swab
#define ultoa _ultoa
static inline char* ecvt(double value, int ndigit, int* decpt, int* sign) { return _ecvt(value, ndigit, decpt, sign); }
static inline char* fcvt(double value, int ndigit, int* decpt, int* sign) { return _fcvt(value, ndigit, decpt, sign); }
static inline char* gcvt(double value, int ndigit, char* buf) { return _gcvt(value, ndigit, buf); }
static inline char* itoa(int value, char* str, int radix) { return _itoa(value, str, radix); }
static inline char* ltoa(long value, char* str, int radix) { return _ltoa(value, str, radix); }
static inline _onexit_t onexit(_onexit_t func) { return _onexit(func); }
static inline int putenv(const char* str) { return _putenv(str); }
static inline void swab(char* src, char* dst, int len) { return _swab(src, dst, len); }
static inline char* ultoa(unsigned long value, char* str, int radix) { return _ultoa(value, str, radix); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_STDLIB_H */

View File

@ -119,29 +119,29 @@ MSVCRT(size_t) MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(s
#ifndef USE_MSVCRT_PREFIX
#define memccpy _memccpy
#define memicmp _memicmp
#define strcasecmp _stricmp
#define strcmpi _strcmpi
#define strdup _strdup
#define stricmp _stricmp
#define stricoll _stricoll
#define strlwr _strlwr
#define strncasecmp _strncasecmp
#define strnicmp _strnicmp
#define strnset _strnset
#define strrev _strrev
#define strset _strset
#define strupr _strupr
static inline void* memccpy(void *s1, const void *s2, int c, MSVCRT(size_t) n) { return _memccpy(s1, s2, c, n); }
static inline int memicmp(const void* s1, const void* s2, MSVCRT(size_t) len) { return _memicmp(s1, s2, len); }
static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
static inline char* strdup(const char* buf) { return _strdup(buf); }
static inline int stricmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
static inline char* strlwr(char* str) { return _strlwr(str); }
static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
static inline int strnicmp(const char* s1, const char* s2, MSVCRT(size_t) n) { return _strnicmp(s1, s2, n); }
static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
static inline char* strrev(char* str) { return _strrev(str); }
static inline char* strset(char* str, int value) { return _strset(str, value); }
static inline char* strupr(char* str) { return _strupr(str); }
#define wcsdup _wcsdup
#define wcsicoll _wcsicoll
#define wcslwr _wcslwr
#define wcsnicmp _wcsnicmp
#define wcsnset _wcsnset
#define wcsrev _wcsrev
#define wcsset _wcsset
#define wcsupr _wcsupr
static inline MSVCRT(wchar_t)* wcsdup(const MSVCRT(wchar_t)* str) { return _wcsdup(str); }
static inline int wcsicoll(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2) { return _wcsicoll(str1, str2); }
static inline MSVCRT(wchar_t)* wcslwr(MSVCRT(wchar_t)* str) { return _wcslwr(str); }
static inline int wcsnicmp(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2, MSVCRT(size_t) n) { return _wcsnicmp(str1, str2, n); }
static inline MSVCRT(wchar_t)* wcsnset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c, MSVCRT(size_t) n) { return _wcsnset(str, c, n); }
static inline MSVCRT(wchar_t)* wcsrev(MSVCRT(wchar_t)* str) { return _wcsrev(str); }
static inline MSVCRT(wchar_t)* wcsset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c) { return _wcsset(str, c); }
static inline MSVCRT(wchar_t)* wcsupr(MSVCRT(wchar_t)* str) { return _wcsupr(str); }
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_STRING_H */