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