Fix linking on Windows
[LibreOffice.git] / libgsf / libgsf-1.14.19.windows.patch
blob56c10c5d8c050a341d1099e3d9cd5ce1262c2045
1 --- misc/libgsf-1.14.19/gsf/gsf-config.h 2011-03-23 16:18:27.163747600 +0100
2 +++ misc/build/libgsf-1.14.19/gsf/gsf-config.h 2011-03-23 16:01:26.598374600 +0100
3 @@ -1 +1,10 @@
4 -dummy
5 +#ifndef GSF_CONFIG_H
6 +#define GSF_CONFIG_H
8 +#define GETTEXT_PACKAGE "gsf"
10 +typedef unsigned short mode_t;
12 +#define S_ISREG(x) ((x & _S_IFREG)!=0)
14 +#endif
15 --- misc/libgsf-1.14.19/gsf/makefile.mk 2011-03-23 16:18:27.070742300 +0100
16 +++ misc/build/libgsf-1.14.19/gsf/makefile.mk 2011-03-23 16:17:29.477448100 +0100
17 @@ -1 +1,120 @@
18 -dummy
19 +#*************************************************************************
21 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
22 +#
23 +# Copyright 2000, 2010 Oracle and/or its affiliates.
25 +# OpenOffice.org - a multi-platform office productivity suite
27 +# This file is part of OpenOffice.org.
29 +# OpenOffice.org is free software: you can redistribute it and/or modify
30 +# it under the terms of the GNU Lesser General Public License version 3
31 +# only, as published by the Free Software Foundation.
33 +# OpenOffice.org is distributed in the hope that it will be useful,
34 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
35 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 +# GNU Lesser General Public License version 3 for more details
37 +# (a copy is included in the LICENSE file that accompanied this code).
39 +# You should have received a copy of the GNU Lesser General Public License
40 +# version 3 along with OpenOffice.org. If not, see
41 +# <http://www.openoffice.org/license.html>
42 +# for a copy of the LGPLv3 License.
44 +#*************************************************************************
46 +PRJ=..$/..$/..$/..$/..
47 +PRJINC=..
48 +PRJNAME=libgsf
49 +TARGET=gsf-1
51 +VISIBILITY_HIDDEN=TRUE
52 +EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
54 +# --- Settings ----------------------------------
56 +.INCLUDE : settings.mk
58 +CFLAGS+= -I.. -I$(SOLARINCDIR)$/external$/glib-2.0 -I$(SOLARINCDIR)$/external$/zlib -I$(SOLARINCDIR)$/external
60 +# --- Files -------------------------------------
62 +SLOFILES=\
63 + $(SLO)$/gsf-blob.obj \
64 + $(SLO)$/gsf-input-memory.obj \
65 + $(SLO)$/gsf-output-gio.obj \
66 + $(SLO)$/gsf-clip-data.obj \
67 + $(SLO)$/gsf-input-proxy.obj \
68 + $(SLO)$/gsf-output-gzip.obj \
69 + $(SLO)$/gsf-doc-meta-data.obj \
70 + $(SLO)$/gsf-input-stdio.obj \
71 + $(SLO)$/gsf-output-iconv.obj \
72 + $(SLO)$/gsf-docprop-vector.obj \
73 + $(SLO)$/gsf-input-textline.obj \
74 + $(SLO)$/gsf-output-iochannel.obj \
75 + $(SLO)$/gsf-infile-msole.obj \
76 + $(SLO)$/gsf-input.obj \
77 + $(SLO)$/gsf-output-memory.obj \
78 + $(SLO)$/gsf-infile-msvba.obj \
79 + $(SLO)$/gsf-libxml.obj \
80 + $(SLO)$/gsf-output-stdio.obj \
81 + $(SLO)$/gsf-infile-stdio.obj \
82 + $(SLO)$/gsf-msole-utils.obj \
83 + $(SLO)$/gsf-output.obj \
84 + $(SLO)$/gsf-infile-tar.obj \
85 + $(SLO)$/gsf-open-pkg-utils.obj \
86 + $(SLO)$/gsf-shared-memory.obj \
87 + $(SLO)$/gsf-infile-zip.obj \
88 + $(SLO)$/gsf-opendoc-utils.obj \
89 + $(SLO)$/gsf-structured-blob.obj \
90 + $(SLO)$/gsf-infile.obj \
91 + $(SLO)$/gsf-outfile-msole.obj \
92 + $(SLO)$/gsf-timestamp.obj \
93 + $(SLO)$/gsf-input-bzip.obj \
94 + $(SLO)$/gsf-outfile-stdio.obj \
95 + $(SLO)$/gsf-utils.obj \
96 + $(SLO)$/gsf-input-gio.obj \
97 + $(SLO)$/gsf-outfile-zip.obj \
98 + $(SLO)$/gsf-zip-utils.obj \
99 + $(SLO)$/gsf-input-gzip.obj \
100 + $(SLO)$/gsf-outfile.obj \
101 + $(SLO)$/version.obj \
102 + $(SLO)$/gsf-input-http.obj \
103 + $(SLO)$/gsf-output-bzip.obj \
104 + $(SLO)$/gsf-input-iochannel.obj \
105 + $(SLO)$/gsf-output-csv.obj
107 +# --- Library -----------------------------------
109 +SHL1TARGET= $(TARGET)
110 +SHL1OBJS=$(SLOFILES)
111 +SHL1STDLIBS=\
112 + libxml2.lib \
113 + gio-2.0.lib \
114 + gmodule-2.0.lib \
115 + gobject-2.0.lib \
116 + glib-2.0.lib \
117 + intl.lib \
118 + zlib.lib \
119 + Advapi32.lib
122 +SHL1IMPLIB= i$(TARGET)
123 +SHL1DEF= $(MISC)$/$(SHL1TARGET).def
125 +DEF1NAME= $(SHL1TARGET)
126 +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \
127 + $(SLB)$/$(TARGET).lib
128 +DEFLIB1NAME=$(TARGET)
130 +# --- Targets ----------------------------------
132 +.INCLUDE : target.mk
134 +# --- filter file ------------------------------
136 +$(MISC)$/$(SHL1TARGET).flt: makefile.mk
137 + @echo CLEAR_THE_FILE > $@
139 --- misc/libgsf-1.14.19/gsf/gsf-infile-zip.c
140 +++ misc/build/libgsf-1.14.19/gsf/gsf-infile-zip.c
141 @@ -30,6 +30,10 @@
143 #include <string.h>
144 #include <zlib.h>
146 +#if defined(Z_PREFIX) && defined(crc32)
147 +#undef crc32
148 +#endif
150 #undef G_LOG_DOMAIN
151 #define G_LOG_DOMAIN "libgsf:zip"
153 --- misc/libgsf-1.14.19/gsf/gsf-outfile-zip.c
154 +++ misc/build/libgsf-1.14.19/gsf/gsf-outfile-zip.c
155 @@ -29,6 +29,11 @@
156 #include <string.h>
157 #include <time.h>
158 #include <zlib.h>
160 +#if defined(Z_PREFIX) && defined(crc32)
161 +#define CRC32_WAS_DEFINED_AS_Z_CRC32
162 +#undef crc32
163 +#endif
165 #undef G_LOG_DOMAIN
166 #define G_LOG_DOMAIN "libgsf:zip"
167 @@ -345,7 +345,11 @@
168 zip_header_write (zip);
169 zip->writing = TRUE;
170 zip->root->writing = TRUE;
171 +#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
172 + dirent->crc32 = z_crc32 (0L, Z_NULL, 0);
173 +#else
174 dirent->crc32 = crc32 (0L, Z_NULL, 0);
175 +#endif
176 if (zip->compression_method == GSF_ZIP_DEFLATED) {
177 if (!zip->stream) {
178 zip->stream = g_new0 (z_stream, 1);
179 @@ -544,7 +544,11 @@
180 return FALSE;
181 dirent->csize += num_bytes;
183 +#if defined(CRC32_WAS_DEFINED_AS_Z_CRC32)
184 + dirent->crc32 = z_crc32 (dirent->crc32, data, num_bytes);
185 +#else
186 dirent->crc32 = crc32 (dirent->crc32, data, num_bytes);
187 +#endif
188 dirent->usize += num_bytes;
190 return TRUE;