From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: [patch] mingw headers [was: Re: #include <.string>] 29 Dec 1998 22:23:04 -0800 Message-ID: References: <19981229154533 DOT 34475 AT cygnus DOT com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: Geoffrey Noer Cc: cygwin32-developers AT cygnus DOT com Here's the patch for mingw headers. Note that I didn't bother including the alloc.h removal in the patch, so you should just delete it. It's not incorporated in malloc.h. Tue Dec 29 15:04:38 1998 Mumit Khan * include/signal.h (sig_atomic_t): Define. (NSIG): Define. * include/malloc.h: Import defs from deprecated alloc.h. * include/alloc.h: Remove. From "Daniel J. Rodriksson" : * include/sys/types.h (_dev_t): Should be unsigned int for MSVCRT. * include/sys/stat.h (struct stat): st_uid is of type short. Use _off_t instead of long for st_size. Index: mingw32/mingw/include/malloc.h diff -u mingw32/mingw/include/malloc.h:1.1.1.2 mingw32/mingw/include/malloc.h:1.2 --- mingw32/mingw/include/malloc.h:1.1.1.2 Wed Feb 4 14:03:07 1998 +++ mingw32/mingw/include/malloc.h Tue Dec 29 15:41:39 1998 @@ -32,13 +32,31 @@ #ifndef _MALLOC_H_ #define _MALLOC_H_ -#include +#include #ifndef RC_INVOKED +/* + * The structure used to walk through the heap with _heapwalk. + * TODO: This is a guess at the internals of this structure. + */ +typedef struct _heapinfo +{ + void* ptr; + unsigned int size; + int in_use; +} _HEAPINFO; + + #ifdef __cplusplus extern "C" { #endif + +int _heapwalk (_HEAPINFO* pHeapinfo); + +#ifndef _NO_OLDNAMES +int heapwalk (_HEAPINFO* pHeapinfo); +#endif /* Not _NO_OLDNAMES */ int _heapchk (); /* Verify heap integrety. */ int _heapmin (); /* Return unused heap to the OS. */ Index: mingw32/mingw/include/signal.h diff -u mingw32/mingw/include/signal.h:1.1.1.3 mingw32/mingw/include/signal.h:1.2 --- mingw32/mingw/include/signal.h:1.1.1.3 Wed Feb 4 14:03:06 1998 +++ mingw32/mingw/include/signal.h Tue Dec 29 15:41:40 1998 @@ -50,6 +50,13 @@ #define SIGTERM 15 /* Termination request */ #define SIGBREAK 21 /* Control-break */ #define SIGABRT 22 /* Abnormal termination (abort) */ + +#ifndef _SIG_ATOMIC_T_DEFINED +typedef int sig_atomic_t; +#define _SIG_ATOMIC_T_DEFINED +#endif + +#define NSIG 23 /* maximum signal number + 1 */ /* * The prototypes (below) are the easy part. The hard part is figuring Index: mingw32/mingw/include/sys/stat.h diff -u mingw32/mingw/include/sys/stat.h:1.2 mingw32/mingw/include/sys/stat.h:1.3 --- mingw32/mingw/include/sys/stat.h:1.2 Thu Sep 3 11:31:18 1998 +++ mingw32/mingw/include/sys/stat.h Tue Dec 29 15:41:40 1998 @@ -97,10 +97,10 @@ _ino_t st_ino; /* Always zero ? */ _mode_t st_mode; /* See above constants */ short st_nlink; /* Number of links. */ - int st_uid; /* User: Maybe significant on NT ? */ + short st_uid; /* User: Maybe significant on NT ? */ short st_gid; /* Group: Ditto */ _dev_t st_rdev; /* Seems useless (not even filled in) */ - long st_size; /* File size in bytes */ + _off_t st_size; /* File size in bytes */ time_t st_atime; /* Accessed date (always 00:00 hrs local * on FAT) */ time_t st_mtime; /* Modified time */ Index: mingw32/mingw/include/sys/types.h diff -u mingw32/mingw/include/sys/types.h:1.6 mingw32/mingw/include/sys/types.h:1.7 --- mingw32/mingw/include/sys/types.h:1.6 Fri Sep 4 15:10:45 1998 +++ mingw32/mingw/include/sys/types.h Tue Dec 29 15:41:40 1998 @@ -57,7 +57,11 @@ #ifndef _DEV_T_ #define _DEV_T_ +#ifdef __MSVCRT__ +typedef unsigned int _dev_t; +#else typedef short _dev_t; +#endif #ifndef _NO_OLDNAMES typedef _dev_t dev_t;