merge the formfield patch from ooo-build
[ooovba.git] / external / glibc-2.1.3.patch
blob4faa30ab19e2bab185a7820b55bf87ff36e86e58
1 --- misc/glibc-2.1.3/posix/config.h Mon Mar 31 09:43:50 2008
2 +++ misc/build/glibc-2.1.3/posix/config.h Mon Mar 31 09:43:26 2008
3 @@ -1 +1,45 @@
4 -dummy
5 +/*************************************************************************
6 + *
7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 + *
9 + * Copyright 2008 by Sun Microsystems, Inc.
10 + *
11 + * OpenOffice.org - a multi-platform office productivity suite
12 + *
13 + * $RCSfile: glibc-2.1.3.patch,v $
14 + * $Revision: 1.5 $
15 + *
16 + * This file is part of OpenOffice.org.
17 + *
18 + * OpenOffice.org is free software: you can redistribute it and/or modify
19 + * it under the terms of the GNU Lesser General Public License version 3
20 + * only, as published by the Free Software Foundation.
21 + *
22 + * OpenOffice.org is distributed in the hope that it will be useful,
23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 + * GNU Lesser General Public License version 3 for more details
26 + * (a copy is included in the LICENSE file that accompanied this code).
27 + *
28 + * You should have received a copy of the GNU Lesser General Public License
29 + * version 3 along with OpenOffice.org. If not, see
30 + * <http://www.openoffice.org/license.html>
31 + * for a copy of the LGPLv3 License.
32 + *
33 + ************************************************************************/
35 +#ifdef WNT
36 +#include <stdlib.h>
37 +#define getenv getenv
38 +#endif
41 +#if defined(MACOSX)
42 +//Workaround for MACOS
43 +#define getopt my_neues_getopt
44 +#define opterr my_neues_opterr
45 +#define optind my_neues_optind
46 +#define optopt my_neues_optopt
47 +#endif
50 --- misc/glibc-2.1.3/posix/getopt.h Sun Aug 27 16:11:33 2000
51 +++ misc/build/glibc-2.1.3/posix/getopt.h Mon Mar 31 09:42:01 2008
52 @@ -137,6 +137,19 @@
53 # endif /* __GNU_LIBRARY__ */
55 # ifndef __need_getopt
56 +# ifdef __MINGW32__
57 +extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts,
58 + const struct option *__longopts, int *__longind);
59 +extern int getopt_long_only (int ___argc, char *const *___argv,
60 + const char *__shortopts,
61 + const struct option *__longopts, int *__longind);
63 +/* Internal only. Users should not call this directly. */
64 +extern int _getopt_internal (int ___argc, char *const *___argv,
65 + const char *__shortopts,
66 + const struct option *__longopts, int *__longind,
67 + int __long_only);
68 +# else
69 extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
70 const struct option *__longopts, int *__longind);
71 extern int getopt_long_only (int __argc, char *const *__argv,
72 @@ -148,6 +161,7 @@
73 const char *__shortopts,
74 const struct option *__longopts, int *__longind,
75 int __long_only);
76 +# endif
77 # endif
78 #else /* not __STDC__ */
79 extern int getopt ();
80 --- misc/glibc-2.1.3/posix/makefile.mk Mon Mar 31 09:43:50 2008
81 +++ misc/build/glibc-2.1.3/posix/makefile.mk Mon Mar 31 09:43:38 2008
82 @@ -1 +1,67 @@
83 -dummy
84 +#*************************************************************************
86 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
87 +#
88 +# Copyright 2008 by Sun Microsystems, Inc.
90 +# OpenOffice.org - a multi-platform office productivity suite
92 +# $RCSfile: glibc-2.1.3.patch,v $
94 +# $Revision: 1.5 $
96 +# This file is part of OpenOffice.org.
98 +# OpenOffice.org is free software: you can redistribute it and/or modify
99 +# it under the terms of the GNU Lesser General Public License version 3
100 +# only, as published by the Free Software Foundation.
102 +# OpenOffice.org is distributed in the hope that it will be useful,
103 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
104 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105 +# GNU Lesser General Public License version 3 for more details
106 +# (a copy is included in the LICENSE file that accompanied this code).
108 +# You should have received a copy of the GNU Lesser General Public License
109 +# version 3 along with OpenOffice.org. If not, see
110 +# <http://www.openoffice.org/license.html>
111 +# for a copy of the LGPLv3 License.
113 +#*************************************************************************
115 +PRJ=..$/..$/..$/..$/..
117 +PRJNAME=external
118 +TARGET=gnu_getopt
119 +LIBTARGET=NO
121 +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
123 +SOLARINC+=-I..
125 +# --- Settings -----------------------------------------------------
127 +.INCLUDE : settings.mk
129 +CDEFS+=-DHAVE_STRING_H -DHAVE_CONFIG_H
131 +# --- Files --------------------------------------------------------
133 +OBJFILES= $(OBJ)$/getopt.obj \
134 + $(OBJ)$/getopt1.obj
136 +LIB1TARGET=$(SLB)$/$(TARGET).lib
137 +LIB1ARCHIV=$(LB)$/lib$(TARGET).a
138 +LIB1OBJFILES=$(OBJFILES)
140 +.IF "$(OS)"=="NETBSD"
141 +TARGET2=gnu_readdir_r
142 +OBJFILES+= $(OBJ)$/readdir_r.obj
143 +LIB2TARGET=$(SLB)$/$(TARGET2).lib
144 +LIB2ARCHIV=$(LB)$/lib$(TARGET2).a
145 +LIB2OBJFILES= $(OBJ)$/readdir_r.obj
146 +.ENDIF
148 +# --- Targets ------------------------------------------------------
150 +.INCLUDE : target.mk
151 --- misc/glibc-2.1.3/posix/readdir_r.c Mon Mar 31 09:43:50 2008
152 +++ misc/build/glibc-2.1.3/posix/readdir_r.c Mon Mar 31 09:42:01 2008
153 @@ -1 +1,56 @@
154 -dummy
155 +/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
156 + This file is part of the GNU C Library.
158 + The GNU C Library is free software; you can redistribute it and/or
159 + modify it under the terms of the GNU Library General Public License as
160 + published by the Free Software Foundation; either version 2 of the
161 + License, or (at your option) any later version.
163 + The GNU C Library is distributed in the hope that it will be useful,
164 + but WITHOUT ANY WARRANTY; without even the implied warranty of
165 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
166 + Library General Public License for more details.
168 + You should have received a copy of the GNU Library General Public
169 + License along with the GNU C Library; see the file COPYING.LIB. If not,
170 + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
171 + Boston, MA 02111-1307, USA. */
173 +#include <errno.h>
174 +#include <limits.h>
175 +#include <stddef.h>
176 +#include <string.h>
177 +#include <dirent.h>
178 +#include <unistd.h>
179 +#include <sys/types.h>
180 +#include <assert.h>
182 +#ifndef __READDIR_R
183 +# define __READDIR_R readdir_r
184 +# define DIRENT_TYPE struct dirent
185 +#endif
187 +/* Read a directory entry from DIRP. */
188 +int
189 +__READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
191 + DIRENT_TYPE *dp;
192 + size_t reclen;
194 + errno = 0;
195 + /* call our non-reentrant counterpart to get the information */
196 + dp = readdir(dirp);
198 + /* copy the result into entry */
199 + if (dp != NULL) {
200 + reclen = dp->d_reclen; /* This might be NetBSD-specific
201 + * Add #ifdef's if anything else needed */
202 + *result = memcpy(entry, dp, reclen);
203 + } else {
204 + *result = NULL;
207 + return dp != NULL ? 0 : errno ? errno : 0;