Patch: errno.diff Martin Wilck <Martin.Wilck@fujitsu-siemens.com> Patch against: CVS 2002-09-17 Modified files: dlls/msvcrt: dir.c errno.c file.c heap.c math.c process.c include: Makefile.in Added files: include/msvcrt: errno.h Removed files: dlls/msvcrt: ms_errno.h MSVCRT needs a public errno.h file because otherwise #include <errno.h> includes /usr/include/errno.h which redefines the "errno" macro, making it impossible for winelib apps to access "errno". Index: dlls/msvcrt/ms_errno.h =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/ms_errno.h,v retrieving revision 1.2 diff -u -r1.2 ms_errno.h --- dlls/msvcrt/ms_errno.h 9 Mar 2002 23:39:08 -0000 1.2 +++ dlls/msvcrt/ms_errno.h 17 Sep 2002 15:27:55 -0000 @@ -1,60 +0,0 @@ -/* - * Copyright 2001 Jon Griffiths - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WINE_MSVCRT_ERRNO_H -#define __WINE_MSVCRT_ERRNO_H - -#define MSVCRT_EPERM 1 -#define MSVCRT_ENOENT 2 -#define MSVCRT_ESRCH 3 -#define MSVCRT_EINTR 4 -#define MSVCRT_EIO 5 -#define MSVCRT_ENXIO 6 -#define MSVCRT_E2BIG 7 -#define MSVCRT_ENOEXEC 8 -#define MSVCRT_EBADF 9 -#define MSVCRT_ECHILD 10 -#define MSVCRT_EAGAIN 11 -#define MSVCRT_ENOMEM 12 -#define MSVCRT_EACCES 13 -#define MSVCRT_EFAULT 14 -#define MSVCRT_EBUSY 16 -#define MSVCRT_EEXIST 17 -#define MSVCRT_EXDEV 18 -#define MSVCRT_ENODEV 19 -#define MSVCRT_ENOTDIR 20 -#define MSVCRT_EISDIR 21 -#define MSVCRT_EINVAL 22 -#define MSVCRT_ENFILE 23 -#define MSVCRT_EMFILE 24 -#define MSVCRT_ENOTTY 25 -#define MSVCRT_EFBIG 27 -#define MSVCRT_ENOSPC 28 -#define MSVCRT_ESPIPE 29 -#define MSVCRT_EROFS 30 -#define MSVCRT_EMLINK 31 -#define MSVCRT_EPIPE 32 -#define MSVCRT_EDOM 33 -#define MSVCRT_ERANGE 34 -#define MSVCRT_EDEADLK 36 -#define MSVCRT_ENAMETOOLONG 38 -#define MSVCRT_ENOLCK 39 -#define MSVCRT_ENOSYS 40 -#define MSVCRT_ENOTEMPTY 41 - -#endif /* __WINE_MSVCRT_ERRNO_H */ Index: dlls/msvcrt/dir.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/dir.c,v retrieving revision 1.13 diff -u -r1.13 dir.c --- dlls/msvcrt/dir.c 12 Sep 2002 22:28:01 -0000 1.13 +++ dlls/msvcrt/dir.c 17 Sep 2002 15:22:18 -0000 @@ -28,7 +28,7 @@ #include "winternl.h" #include "wine/unicode.h" #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #include "wine/unicode.h" #include "msvcrt/direct.h" Index: dlls/msvcrt/errno.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/errno.c,v retrieving revision 1.8 diff -u -r1.8 errno.c --- dlls/msvcrt/errno.c 19 Jul 2002 03:24:50 -0000 1.8 +++ dlls/msvcrt/errno.c 17 Sep 2002 15:22:18 -0000 @@ -19,7 +19,7 @@ */ #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #include <stdio.h> #include <string.h> Index: dlls/msvcrt/file.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/file.c,v retrieving revision 1.38 diff -u -r1.38 file.c --- dlls/msvcrt/file.c 16 Sep 2002 22:39:50 -0000 1.38 +++ dlls/msvcrt/file.c 17 Sep 2002 15:22:18 -0000 @@ -32,7 +32,7 @@ #include "winternl.h" #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #include "wine/unicode.h" #include "msvcrt/direct.h" Index: dlls/msvcrt/heap.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/heap.c,v retrieving revision 1.12 diff -u -r1.12 heap.c --- dlls/msvcrt/heap.c 19 Jul 2002 03:24:50 -0000 1.12 +++ dlls/msvcrt/heap.c 17 Sep 2002 15:22:18 -0000 @@ -22,7 +22,7 @@ */ #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #include "msvcrt/malloc.h" #include "msvcrt/stdlib.h" Index: dlls/msvcrt/math.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/math.c,v retrieving revision 1.16 diff -u -r1.16 math.c --- dlls/msvcrt/math.c 7 Aug 2002 01:18:41 -0000 1.16 +++ dlls/msvcrt/math.c 17 Sep 2002 15:22:18 -0000 @@ -19,7 +19,7 @@ */ #include "config.h" #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #define __USE_ISOC9X 1 #define __USE_ISOC99 1 Index: dlls/msvcrt/process.c =================================================================== RCS file: /home/wine/wine/dlls/msvcrt/process.c,v retrieving revision 1.13 diff -u -r1.13 process.c --- dlls/msvcrt/process.c 9 Aug 2002 19:49:32 -0000 1.13 +++ dlls/msvcrt/process.c 17 Sep 2002 15:22:18 -0000 @@ -30,7 +30,7 @@ #include <stdarg.h> #include "msvcrt.h" -#include "ms_errno.h" +#include "msvcrt/errno.h" #include "msvcrt/process.h" #include "msvcrt/stdlib.h" Index: include/Makefile.in =================================================================== RCS file: /home/wine/wine/include/Makefile.in,v retrieving revision 1.61 diff -u -r1.61 Makefile.in --- include/Makefile.in 17 Sep 2002 00:03:39 -0000 1.61 +++ include/Makefile.in 17 Sep 2002 15:22:21 -0000 @@ -67,6 +67,7 @@ msvcrt/direct.h \ msvcrt/dos.h \ msvcrt/eh.h \ + msvcrt/errno.h \ msvcrt/excpt.h \ msvcrt/fcntl.h \ msvcrt/io.h \ --- /dev/null Thu Apr 11 16:25:15 2002 +++ include/msvcrt/errno.h Tue Sep 17 17:14:11 2002 @@ -0,0 +1,105 @@ +/* + * Copyright 2001 Jon Griffiths + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINE_ERRNO_H +#define __WINE_ERRNO_H +#define __WINE_USE_MSVCRT + +#ifdef USE_MSVCRT_PREFIX + +# define MSVCRT_EPERM 1 +# define MSVCRT_ENOENT 2 +# define MSVCRT_ESRCH 3 +# define MSVCRT_EINTR 4 +# define MSVCRT_EIO 5 +# define MSVCRT_ENXIO 6 +# define MSVCRT_E2BIG 7 +# define MSVCRT_ENOEXEC 8 +# define MSVCRT_EBADF 9 +# define MSVCRT_ECHILD 10 +# define MSVCRT_EAGAIN 11 +# define MSVCRT_ENOMEM 12 +# define MSVCRT_EACCES 13 +# define MSVCRT_EFAULT 14 +# define MSVCRT_EBUSY 16 +# define MSVCRT_EEXIST 17 +# define MSVCRT_EXDEV 18 +# define MSVCRT_ENODEV 19 +# define MSVCRT_ENOTDIR 20 +# define MSVCRT_EISDIR 21 +# define MSVCRT_EINVAL 22 +# define MSVCRT_ENFILE 23 +# define MSVCRT_EMFILE 24 +# define MSVCRT_ENOTTY 25 +# define MSVCRT_EFBIG 27 +# define MSVCRT_ENOSPC 28 +# define MSVCRT_ESPIPE 29 +# define MSVCRT_EROFS 30 +# define MSVCRT_EMLINK 31 +# define MSVCRT_EPIPE 32 +# define MSVCRT_EDOM 33 +# define MSVCRT_ERANGE 34 +# define MSVCRT_EDEADLK 36 +# define MSVCRT_ENAMETOOLONG 38 +# define MSVCRT_ENOLCK 39 +# define MSVCRT_ENOSYS 40 +# define MSVCRT_ENOTEMPTY 41 + +#else /* USE_MSVCRT_PREFIX */ + +# define EPERM 1 +# define ENOENT 2 +# define ESRCH 3 +# define EINTR 4 +# define EIO 5 +# define ENXIO 6 +# define E2BIG 7 +# define ENOEXEC 8 +# define EBADF 9 +# define ECHILD 10 +# define EAGAIN 11 +# define ENOMEM 12 +# define EACCES 13 +# define EFAULT 14 +# define EBUSY 16 +# define EEXIST 17 +# define EXDEV 18 +# define ENODEV 19 +# define ENOTDIR 20 +# define EISDIR 21 +# define EINVAL 22 +# define ENFILE 23 +# define EMFILE 24 +# define ENOTTY 25 +# define EFBIG 27 +# define ENOSPC 28 +# define ESPIPE 29 +# define EROFS 30 +# define EMLINK 31 +# define EPIPE 32 +# define EDOM 33 +# define ERANGE 34 +# define EDEADLK 36 +# define ENAMETOOLONG 38 +# define ENOLCK 39 +# define ENOSYS 40 +# define ENOTEMPTY 41 + +#endif /* USE_MSVCRT_PREFIX */ + +#endif /* __WINE_ERRNO_H */ -- Martin Wilck Phone: +49 5251 8 15113 Fujitsu Siemens Computers Fax: +49 5251 8 20409 Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck@Fujitsu-Siemens.com D-33106 Paderborn http://www.fujitsu-siemens.com/primergy