diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 72ae3ce5a..c9c5644e8 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,27 @@ +2002-06-18 Casper S. Hornstrup + + * include/_mingw.h (__MINGW_IMPORT): Check for prior definition before + defining. + * include/excpt.h (): Include windef.h not windows.h. + * include/fcntl.h (_O_SHORT_LIVED): Add define. + (_chmod): Add prototype. + (_creat): Correct prototype. + (SH_DENY*): Rename defines to _SH_DENY*. + (SH_DENY*): Add Non-ANSI names for _SH_DENY*. + include/stdio.h (_IOMYBUF, _IOEOF, _IOERR, _IOSTRG, + _IOAPPEND): Add defines. + (_wfindfirst): Correct prototype. + (_wfdopen): Add prototype. + * include/stdlib.h (_rotl, _rotr, _lrotl, _lrotr): Add + prototypes. + * include/string.h (_mbschr, _mbstok, _mbsncat): Remove + prototypes. + (_wcsdup): Correct prototype. + * include/mbstring.h: Remove comments about _mbschr, _mbstok, + _mbsncat being in string.h. + * include/wchar.h (_wfindfirst): Correct prototype. + * include/tchar.h (_tfdopen): Add _UNICODE mappings. + 2002-06-15 Earnie Boyd * include/_mingw.h: Increment to version 2.1. diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h index 0ee41f3fe..33b808d2a 100644 --- a/winsup/mingw/include/_mingw.h +++ b/winsup/mingw/include/_mingw.h @@ -44,13 +44,18 @@ style declarations. */ #ifndef __GNUC__ -# define __MINGW_IMPORT __declspec(dllimport) +# ifndef __MINGW_IMPORT +# define __MINGW_IMPORT __declspec(dllimport) +# endif # define __DECLSPEC_SUPPORTED #else /* __GNUC__ */ # ifdef __declspec +# ifndef __MINGW_IMPORT + /* Note the extern. This is needed to work around GCC's limitations in handling dllimport attribute. */ -# define __MINGW_IMPORT extern __attribute__((dllimport)) +# define __MINGW_IMPORT extern __attribute__((dllimport)) +# endif # define __DECLSPEC_SUPPORTED # else # undef __DECLSPEC_SUPPORTED diff --git a/winsup/mingw/include/excpt.h b/winsup/mingw/include/excpt.h index 0947b2291..20a2d721a 100644 --- a/winsup/mingw/include/excpt.h +++ b/winsup/mingw/include/excpt.h @@ -36,7 +36,7 @@ #ifndef __STRICT_ANSI__ -#include +#include /* * NOTE: The constants structs and typedefs below should be defined in the diff --git a/winsup/mingw/include/fcntl.h b/winsup/mingw/include/fcntl.h index bcc7bca47..7b7a8cb2a 100644 --- a/winsup/mingw/include/fcntl.h +++ b/winsup/mingw/include/fcntl.h @@ -58,6 +58,8 @@ #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ #define _O_EXCL 0x0400 /* Open only if the file does not exist. */ +#define _O_SHORT_LIVED 0x1000 + /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ #define _O_BINARY 0x8000 /* Input and output is not translated. */ diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h index ea86ffa0c..84014c794 100644 --- a/winsup/mingw/include/io.h +++ b/winsup/mingw/include/io.h @@ -125,6 +125,7 @@ char* _getcwd (char*, int); int _mkdir (const char*); char* _mktemp (char*); int _rmdir (const char*); +int _chmod (const char*, int); #ifdef __MSVCRT__ @@ -144,6 +145,7 @@ char* getcwd (char*, int); int mkdir (const char*); char* mktemp (char*); int rmdir (const char*); +int chmod (const char*, int); #endif /* _UWIN */ #endif /* Not _NO_OLDNAMES */ @@ -181,7 +183,7 @@ int _commit(int); /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), * the "owner write permission" bit (on FAT). */ -int _creat (const char*, unsigned); +int _creat (const char*, int); int _dup (int); int _dup2 (int, int); @@ -228,7 +230,7 @@ int _write (int, const void*, unsigned int); int _waccess(const wchar_t*, int); int _wchmod(const wchar_t*, int); int _wcreat(const wchar_t*, int); -long _wfindfirst(wchar_t*, struct _wfinddata_t*); +long _wfindfirst(const wchar_t*, struct _wfinddata_t*); int _wfindnext(long, struct _wfinddata_t *); int _wunlink(const wchar_t*); int _wopen(const wchar_t*, int, ...); diff --git a/winsup/mingw/include/mbstring.h b/winsup/mingw/include/mbstring.h index d4afc1a54..6b89ebd76 100644 --- a/winsup/mingw/include/mbstring.h +++ b/winsup/mingw/include/mbstring.h @@ -76,13 +76,13 @@ unsigned char* _mbsnset (unsigned char*, unsigned int, size_t); unsigned char* _mbsnbset (unsigned char*, unsigned int, size_t); unsigned char* _mbsdup (const unsigned char*); unsigned char* _mbsrev (unsigned char*); -unsigned char* _mbscat (unsigned char*, const unsigned char*); /* also in string.h */ +unsigned char* _mbscat (unsigned char*, const unsigned char*); unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t); unsigned char* _mbsnbcat (unsigned char*, const unsigned char*, size_t); size_t _mbslen (const unsigned char*); size_t _mbsnbcnt (const unsigned char*, size_t); size_t _mbsnccnt (const unsigned char*, size_t); -unsigned char* _mbschr (const unsigned char*, unsigned int); /* also in string.h */ +unsigned char* _mbschr (const unsigned char*, unsigned int); unsigned char* _mbsrchr (const unsigned char*, unsigned int); size_t _mbsspn (const unsigned char*, const unsigned char*); size_t _mbscspn (const unsigned char*, const unsigned char*); @@ -107,7 +107,7 @@ unsigned char* _mbsdec (const unsigned char*, const unsigned char*); unsigned int _mbsnextc (const unsigned char*); unsigned char* _mbslwr (unsigned char*); unsigned char* _mbsupr (unsigned char*); -unsigned char* _mbstok (unsigned char*, const unsigned char*); /* also in string.h */ +unsigned char* _mbstok (unsigned char*, const unsigned char*); /* Kanji */ int _ismbchira (unsigned int); diff --git a/winsup/mingw/include/share.h b/winsup/mingw/include/share.h index 7c4b1c6b0..605d7e796 100644 --- a/winsup/mingw/include/share.h +++ b/winsup/mingw/include/share.h @@ -32,11 +32,25 @@ /* All the headers include this file. */ #include <_mingw.h> -#define SH_COMPAT 0x00 /* Compatibility */ -#define SH_DENYRW 0x10 /* Deny read/write */ -#define SH_DENYWR 0x20 /* Deny write */ -#define SH_DENYRD 0x30 /* Deny read */ -#define SH_DENYNO 0x40 /* Deny nothing */ +#define _SH_COMPAT 0x00 /* Compatibility */ +#define _SH_DENYRW 0x10 /* Deny read/write */ +#define _SH_DENYWR 0x20 /* Deny write */ +#define _SH_DENYRD 0x30 /* Deny read */ +#define _SH_DENYNO 0x40 /* Deny nothing */ + +#ifndef __STRICT_ANSI__ + +#ifndef _NO_OLDNAMES + +/* Non ANSI names */ +#define SH_DENYRW _SH_DENYRW +#define SH_DENYWR _SH_DENYWR +#define SH_DENYRD _SH_DENYRD +#define SH_DENYNO _SH_DENYNO + +#endif /* Not _NO_OLDNAMES */ + +#endif /* Not __STRICT_ANSI__ */ #endif /* Not _SHARE_H_ */ diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h index fd5827ad0..6578ebebd 100644 --- a/winsup/mingw/include/stdio.h +++ b/winsup/mingw/include/stdio.h @@ -46,8 +46,8 @@ /* Flags for the iobuf structure */ -#define _IOREAD 1 -#define _IOWRT 2 +#define _IOREAD 1 /* currently reading */ +#define _IOWRT 2 /* currently writing */ #define _IORW 0x0080 /* opened as "r+w" */ @@ -96,10 +96,17 @@ */ #define L_tmpnam (16) -#define _IOFBF 0x0000 -#define _IOLBF 0x0040 -#define _IONBF 0x0004 +#define _IOFBF 0x0000 /* full buffered */ +#define _IOLBF 0x0040 /* line buffered */ +#define _IONBF 0x0004 /* not buffered */ +#define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ +#define _IOEOF 0x0010 /* EOF reached on read */ +#define _IOERR 0x0020 /* I/O error from system */ +#define _IOSTRG 0x0040 /* Strange or no file descriptor */ +#ifdef _POSIX_SOURCE +# define _IOAPPEND 0x0200 +#endif /* * The buffer size as used by setbuf such that it is equivalent to * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). @@ -353,6 +360,7 @@ wchar_t* _getws (wchar_t*); wint_t putwc (wint_t, FILE*); int _putws (const wchar_t*); wint_t putwchar (wint_t); +FILE* _wfdopen(int, wchar_t *); FILE* _wfopen (const wchar_t*, const wchar_t*); FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*); FILE* _wfsopen (const wchar_t*, const wchar_t*, int); diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index bc5884278..1dade6d0b 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -416,6 +416,11 @@ void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t); + +unsigned int _rotl(unsigned int, int); +unsigned int _rotr(unsigned int, int); +unsigned long _lrotl(unsigned long, int); +unsigned long _lrotr(unsigned long, int); #endif #ifndef _NO_OLDNAMES diff --git a/winsup/mingw/include/string.h b/winsup/mingw/include/string.h index 038487b0c..2a767a0b6 100644 --- a/winsup/mingw/include/string.h +++ b/winsup/mingw/include/string.h @@ -91,13 +91,6 @@ char* _strset (char*, int); char* _strupr (char*); void _swab (const char*, char*, size_t); -/* - * Multi-byte character functions - */ -unsigned char* _mbschr (unsigned char*, unsigned char*); -unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t); -unsigned char* _mbstok (unsigned char*, unsigned char*); - #ifdef __MSVCRT__ int _strncoll(const char*, const char*, size_t); int _strnicoll(const char*, const char*, size_t); @@ -134,7 +127,7 @@ size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ #define _wcscmpi _wcsicmp -wchar_t* _wcsdup (wchar_t*); +wchar_t* _wcsdup (const wchar_t*); int _wcsicmp (const wchar_t*, const wchar_t*); int _wcsicoll (const wchar_t*, const wchar_t*); wchar_t* _wcslwr (wchar_t*); diff --git a/winsup/mingw/include/tchar.h b/winsup/mingw/include/tchar.h index bc6f28f5c..7ab12c29a 100644 --- a/winsup/mingw/include/tchar.h +++ b/winsup/mingw/include/tchar.h @@ -187,6 +187,7 @@ typedef wchar_t _TCHAR; #define _tcreat _wcreat #define _tfindfirst _wfindfirst #define _tfindnext _wfindnext +#define _tfopen _wfdopen #define _tfopen _wfopen #define _tgetenv _wgetenv #define _tputenv _wputenv @@ -264,6 +265,7 @@ typedef char _TCHAR; #define _fputtc fputc #define _fputtchar _fputchar #define _fputts fputs +#define _tfdopen _fdopen #define _tfopen fopen #define _tgetenv getenv #define _tputenv _putenv diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h index 61408e98e..e33df6152 100644 --- a/winsup/mingw/include/wchar.h +++ b/winsup/mingw/include/wchar.h @@ -88,7 +88,7 @@ struct _wfinddatai64_t { int _waccess (const wchar_t*, int); int _wchmod (const wchar_t*, int); int _wcreat (const wchar_t*, int); -long _wfindfirst (wchar_t*, struct _wfinddata_t *); +long _wfindfirst (const wchar_t*, struct _wfinddata_t *); int _wfindnext (long, struct _wfinddata_t *); int _wunlink (const wchar_t*); int _wopen (const wchar_t*, int, ...); @@ -133,7 +133,7 @@ wchar_t* _getws (wchar_t*); wint_t putwc (wint_t, FILE*); int _putws (const wchar_t*); wint_t putwchar (wint_t); - +FILE* _wfdopen(int, wchar_t *); FILE* _wfopen (const wchar_t*, const wchar_t*); FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*); FILE* _wfsopen (const wchar_t*, const wchar_t*, int);