Update to m13
[ooovba.git] / applied_patches / 0203-speed-local-link-except.diff
blobf619734524d173c7511cef15aa7554c48ff6a61e
1 diff --git codemaker/source/cppumaker/cppumaker.cxx codemaker/source/cppumaker/cppumaker.cxx
2 index d2be93f..31bf594 100644
3 --- codemaker/source/cppumaker/cppumaker.cxx
4 +++ codemaker/source/cppumaker/cppumaker.cxx
5 @@ -37,6 +37,7 @@
7 #include "codemaker/typemanager.hxx"
8 #include "codemaker/generatedtypeset.hxx"
9 +#include "codemaker/commoncpp.hxx"
11 #include "cppuoptions.hxx"
12 #include "cpputype.hxx"
13 @@ -241,6 +242,43 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
14 exit(99);
17 + if (!aExceptionTypeNames.empty() && options.isValid("-E"))
18 + {
19 + OString outFile = options.getOption("-E");
20 + FILE *excepts = fopen (outFile, "w+");
21 + if (!excepts)
22 + {
23 + fprintf(stderr, "%s ERROR: cannot open '%s'\n",
24 + options.getProgramName().getStr(), outFile.getStr());
25 + exit(98);
26 + }
27 + fprintf (excepts, "// This file is autogenerated by cppumaker\n");
28 + fprintf (excepts, "// include exception headers\n");
30 + ::std::list<rtl::OString>::const_iterator iter;
32 + for (iter = aExceptionTypeNames.begin();
33 + iter != aExceptionTypeNames.end(); iter++)
34 + {
35 + rtl::OString aStr = *iter;
36 + fprintf (excepts, "#include <%s.hpp>\n", aStr.getStr());
37 + }
39 + fprintf (excepts, "// dummy method\n");
40 + fprintf (excepts, "extern void force_emit ()\n");
41 + fprintf (excepts, "{\n");
42 + for (iter = aExceptionTypeNames.begin();
43 + iter != aExceptionTypeNames.end(); iter++) {
44 + fprintf (excepts, " try {\n");
45 + fprintf (excepts, " force_emit ();\n");
46 + fprintf (excepts, " }\n");
47 + OString aStr = codemaker::cpp::scopedCppName (*iter);
48 + fprintf (excepts, "catch (const %s &r) {} \n", aStr.getStr());
49 + }
50 + fprintf (excepts, "}\n\n");
51 + fclose (excepts);
52 + }
54 return 0;
57 diff --git codemaker/source/cppumaker/cppuoptions.cxx codemaker/source/cppumaker/cppuoptions.cxx
58 index cdce000..1f9119b 100644
59 --- codemaker/source/cppumaker/cppuoptions.cxx
60 +++ codemaker/source/cppumaker/cppuoptions.cxx
61 @@ -70,6 +70,9 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
63 switch (av[i][1])
65 + case 'E':
66 + m_options["-E"] = OString(av[i] + 2);
67 + break;
68 case 'O':
69 if (av[i][2] == '\0')
71 @@ -342,6 +345,7 @@ OString CppuOptions::prepareHelp()
72 help += " -G = generate only target files which does not exists.\n";
73 help += " -Gc = generate only target files which content will be changed.\n";
74 help += " -X<file> = extra types which will not be taken into account for generation.\n";
75 + help += " -E<file> = generate exception type library for faster Linux linking.\n";
76 help += prepareVersion();
78 return help;
79 diff --git codemaker/source/cppumaker/cpputype.cxx codemaker/source/cppumaker/cpputype.cxx
80 index 69fa71a..7a2359f 100644
81 --- codemaker/source/cppumaker/cpputype.cxx
82 +++ codemaker/source/cppumaker/cpputype.cxx
83 @@ -56,6 +56,8 @@
84 using namespace rtl;
85 using namespace codemaker::cpp;
87 +::std::list<rtl::OString> aExceptionTypeNames;
89 namespace {
91 rtl::OString translateSimpleUnoType(rtl::OString const & unoType, bool cppuUnoType=false) {
92 @@ -3077,6 +3079,13 @@ sal_Bool ExceptionType::dumpHFile(
93 return sal_True;
96 +bool
97 +ExceptionType::dumpFiles(CppuOptions * options, rtl::OString const & outPath)
99 + aExceptionTypeNames.push_back(m_typeName);
100 + return CppuType::dumpFiles(options, outPath);
103 sal_Bool ExceptionType::dumpDeclaration(FileStream& o)
104 throw( CannotDumpException )
106 diff --git codemaker/source/cppumaker/cpputype.hxx codemaker/source/cppumaker/cpputype.hxx
107 index c8c5f34..2140f3e 100644
108 --- codemaker/source/cppumaker/cpputype.hxx
109 +++ codemaker/source/cppumaker/cpputype.hxx
110 @@ -56,6 +56,9 @@ enum CppuTypeDecl
111 class CppuOptions;
112 class FileStream;
114 +#include <list>
115 +extern ::std::list<rtl::OString> aExceptionTypeNames;
117 class CppuType
119 public:
120 @@ -295,6 +298,7 @@ public:
122 virtual ~ExceptionType();
124 + bool dumpFiles(CppuOptions * options, rtl::OString const & outPath);
125 sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException );
126 sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException );
127 sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException );
128 diff --git cppu/prj/build.lst cppu/prj/build.lst
129 index a0caa14..4de1deb 100644
130 --- cppu/prj/build.lst
131 +++ cppu/prj/build.lst
132 @@ -8,4 +8,5 @@ cu cppu\source\cppu nmake - all cu_cppu cu_inc NULL
133 cu cppu\source\helper\purpenv nmake - all cu_helper_purpenv cu_inc NULL
134 cu cppu\source\UnsafeBridge nmake - all cu_UnsafeBridge cu_inc NULL
135 cu cppu\source\AffineBridge nmake - all cu_AffineBridge cu_inc NULL
136 -cu cppu\util nmake - all cu_util cu_thpool cu_typelib cu_cppu cu_uno cu_helper_purpenv cu_UnsafeBridge cu_AffineBridge NULL
137 +cu cppu\util nmake - all cu_util cu_thpool cu_typelib cu_cppu cu_uno cu_helper_purpenv cu_UnsafeBridge cu_AffineBridge NULL
138 +cu cppu\source\except nmake - all cu_except cu_util NULL
139 diff --git cppu/prj/d.lst cppu/prj/d.lst
140 index f019d78..c40325b 100644
141 --- cppu/prj/d.lst
142 +++ cppu/prj/d.lst
143 @@ -56,6 +56,7 @@ mkdir: %_DEST%\inc%_EXT%\uno
144 ..\%__SRC%\lib\icppu.lib %_DEST%\lib%_EXT%\icppu.lib
145 ..\%__SRC%\bin\cppu* %_DEST%\bin%_EXT%\*
146 ..\%__SRC%\lib\libuno_cppu.*.* %_DEST%\lib%_EXT%\*
147 +..\%__SRC%\lib\libexlink* %_DEST%\lib%_EXT%\*
149 ..\%__SRC%\lib\ipurpenvhelper* %_DEST%\lib%_EXT%\*
150 ..\%__SRC%\bin\purpe*.dll %_DEST%\bin%_EXT%\*
151 diff --git cppu/source/except/except.cxx cppu/source/except/except.cxx
152 new file mode 100644
153 index 0000000..4406885
154 --- /dev/null
155 +++ cppu/source/except/except.cxx
156 @@ -0,0 +1,15 @@
157 +#include <sal/config.h>
158 +#include <cppu/macros.hxx>
159 +#include <com/sun/star/uno/Any.hxx>
160 +#include <com/sun/star/uno/Reference.hxx>
162 +// We don't want to hide all this shared goodness:
163 +#undef CPPU_GCC_DLLPUBLIC_EXPORT
164 +#define CPPU_GCC_DLLPUBLIC_EXPORT
165 +#undef CPPU_GCC_DLLPRIVATE
166 +#define CPPU_GCC_DLLPRIVATE
168 +#define CPPU_INTERNAL_IMPL 1
170 +#include <linking_catch.hxx>
172 diff --git cppu/source/except/makefile.mk cppu/source/except/makefile.mk
173 new file mode 100644
174 index 0000000..66e6328
175 --- /dev/null
176 +++ cppu/source/except/makefile.mk
177 @@ -0,0 +1,21 @@
178 +# --- Settings -----------------------------------------------------
180 +PRJ=..$/..
182 +PRJNAME=cppu
183 +TARGET=unotypes
184 +ENABLE_EXCEPTIONS=TRUE
186 +.INCLUDE : settings.mk
188 +LIB1TARGET= $(SLB)$/$(TARGET).lib
189 +LIB1OBJFILES= $(SLO)$/except.obj
191 +SHL1TARGET=exlink$(DLLPOSTFIX)
192 +SHL1LIBS=$(LIB1TARGET)
193 +SHL1STDLIBS= $(SALLIB) $(SALHELPERLIB) $(REGLIB) $(CPPULIB)
195 +# --- Targets -------------------------------------------------------
197 +.INCLUDE : target.mk
199 diff --git offuh/source/makefile.mk offuh/source/makefile.mk
200 index 8c490a8..a257099 100644
201 --- offuh/source/makefile.mk
202 +++ offuh/source/makefile.mk
203 @@ -41,7 +41,7 @@ TARGET= offuh
205 $(MISC)$/$(TARGET).don : $(UNOUCRRDB)
206 @@-$(RM) $@
207 - $(CPPUMAKER) -Gc $(CPPUMAKERFLAGS) -B$(UNOUCRBASE) -O$(UNOUCROUT) $(UNOUCRRDB) && echo > $@
208 + $(CPPUMAKER) -E$(UNOUCROUT)/linking_catch.hxx -Gc $(CPPUMAKERFLAGS) -B$(UNOUCRBASE) -O$(UNOUCROUT) $(UNOUCRRDB) && echo > $@
210 # --- Targets ------------------------------------------------------
212 diff --git scp2/source/ooo/file_library_ooo.scp scp2/source/ooo/file_library_ooo.scp
213 index dbbe327..abc0c7c 100644
214 --- scp2/source/ooo/file_library_ooo.scp
215 +++ scp2/source/ooo/file_library_ooo.scp
216 @@ -200,6 +200,15 @@ STD_UNO_LIB_FILE( gid_File_Lib_Ctl , ctl)
218 STD_LIB_FILE_PATCH( gid_File_Lib_Cui, cui)
220 +#ifdef LINUX
221 +File gid_File_Lib_ExLib
222 + TXT_FILE_BODY;
223 + Styles = (PACKED,PATCH);
224 + Dir = gid_Dir_Program;
225 + Name = LIBNAME(exlink);
226 +End
227 +#endif
229 #ifndef SYSTEM_CURL
231 File gid_File_Lib_Curl