diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-03 21:04:16 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-03 21:13:17 +0300 |
commit | 7aa6f1b01481c1d0f1a12f56ad197c797056c37b (patch) | |
tree | 3fa3525ad487c08a3e126b0eae6ef0822b25aa75 | |
parent | d8842c2221cb5e6ea958381f9dcd76d9bb9bbafc (diff) |
Remove Mac OS X for PowerPC support
Change-Id: I10b15141e6a5f93365e1cfa6fbc0c7cc3ea49b15
-rw-r--r-- | README.cross | 21 | ||||
-rw-r--r-- | bridges/Library_cpp_uno.mk | 6 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx | 719 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx | 277 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx | 85 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx | 636 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_platform.cxx | 3 | ||||
-rw-r--r-- | helpcompiler/Library_helplinker.mk | 7 | ||||
-rw-r--r-- | jpeg/UnpackedTarball_jpeg.mk | 6 | ||||
-rw-r--r-- | jpeg/patches/struct_alignment.patch | 48 | ||||
-rw-r--r-- | libxmlsec/UnpackedTarball_xmlsec.mk | 6 | ||||
-rw-r--r-- | libxmlsec/xmlsec1-1.2.14_old_automake.patch | 126 | ||||
-rw-r--r-- | nss/ExternalProject_nss.mk | 1 | ||||
-rw-r--r-- | odk/settings/settings.mk | 3 | ||||
-rw-r--r-- | solenv/bin/modules/installer/download.pm | 5 | ||||
-rw-r--r-- | testtools/Module_testtools.mk | 4 | ||||
-rw-r--r-- | xpdf/ExternalProject_xpdf.mk | 1 |
18 files changed, 2 insertions, 1970 deletions
diff --git a/README.cross b/README.cross index 7b6cb65473e2..87aa95d78047 100644 --- a/README.cross +++ b/README.cross | |||
@@ -2,7 +2,7 @@ Cross-compiling LibreOffice | |||
2 | *************************** | 2 | *************************** |
3 | 3 | ||
4 | Cross-compilation works, to various degree, to the following | 4 | Cross-compilation works, to various degree, to the following |
5 | platforms: Windows, iOS, Android, PowerPC Mac OS X, Raspbian. | 5 | platforms: Windows, iOS, Android, and Raspbian. |
6 | 6 | ||
7 | 7 | ||
8 | General | 8 | General |
@@ -391,25 +391,6 @@ To debug, do manually what "make run" would do and when the app has | |||
391 | started, run ndk-gdb. | 391 | started, run ndk-gdb. |
392 | 392 | ||
393 | 393 | ||
394 | PowerPC Mac OS X | ||
395 | **************** | ||
396 | |||
397 | Cross-compiling for PowerPC Mac OS X from Intel Mac OS X is easy in | ||
398 | theory. The APIs available should after all be closely identical to | ||
399 | those on a corrersponding (obsolete) version of Mac OS X for Intel, | ||
400 | and LibreOffice builds fine natively on PowerPC Mac already. Only a | ||
401 | little experimenting has been done with it, and it seems that nobody | ||
402 | actually is interested in it. An autogen.lastrun looked like this when | ||
403 | last tried: | ||
404 | |||
405 | CC=ccache /Xcode3/usr/bin/gcc-4.0 -arch ppc | ||
406 | CXX=ccache /Xcode3/usr/bin/g++-4.0 -arch ppc | ||
407 | CC_FOR_BUILD=ccache /Xcode3/usr/bin/gcc-4.0 | ||
408 | CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 | ||
409 | --build=i386-apple-darwin10.7.0 | ||
410 | --host=powerpc-apple-darwin10 | ||
411 | |||
412 | |||
413 | Raspbian | 394 | Raspbian |
414 | ******** | 395 | ******** |
415 | 396 | ||
diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk index 987517d6a8c4..b19753f67b5c 100644 --- a/bridges/Library_cpp_uno.mk +++ b/bridges/Library_cpp_uno.mk | |||
@@ -142,12 +142,6 @@ bridge_noopt_objects := except | |||
142 | bridge_asm_objects := call | 142 | bridge_asm_objects := call |
143 | endif | 143 | endif |
144 | 144 | ||
145 | else ifeq ($(OS)$(CPU),MACOSXP) | ||
146 | |||
147 | bridges_SELECTED_BRIDGE := gcc3_macosx_powerpc | ||
148 | bridge_noopt_objects := uno2cpp | ||
149 | bridge_exception_objects := cpp2uno except | ||
150 | |||
151 | else ifeq ($(OS)$(CPU),SOLARISI) | 145 | else ifeq ($(OS)$(CPU),SOLARISI) |
152 | 146 | ||
153 | bridges_SELECTED_BRIDGE := gcc3_solaris_intel | 147 | bridges_SELECTED_BRIDGE := gcc3_solaris_intel |
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx deleted file mode 100644 index 7fb88fe723be..000000000000 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx +++ /dev/null | |||
@@ -1,719 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | |||
21 | #include <com/sun/star/uno/genfunc.hxx> | ||
22 | #include <uno/data.h> | ||
23 | #include <typelib/typedescription.hxx> | ||
24 | |||
25 | #include "bridges/cpp_uno/shared/bridge.hxx" | ||
26 | #include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" | ||
27 | #include "bridges/cpp_uno/shared/types.hxx" | ||
28 | #include "bridges/cpp_uno/shared/vtablefactory.hxx" | ||
29 | |||
30 | #include "share.hxx" | ||
31 | |||
32 | using namespace ::com::sun::star::uno; | ||
33 | |||
34 | namespace | ||
35 | { | ||
36 | |||
37 | //================================================================================================== | ||
38 | static typelib_TypeClass cpp2uno_call( | ||
39 | bridges::cpp_uno::shared::CppInterfaceProxy * pThis, | ||
40 | const typelib_TypeDescription * pMemberTypeDescr, | ||
41 | typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return | ||
42 | sal_Int32 nParams, typelib_MethodParameter * pParams, | ||
43 | void ** gpreg, void ** fpreg, void ** ovrflw, | ||
44 | sal_Int64 * pRegisterReturn /* space for register return */ ) | ||
45 | { | ||
46 | |||
47 | // gpreg: [ret *], this, [gpr params] | ||
48 | // fpreg: [fpr params] | ||
49 | // ovrflw: [gpr or fpr params (space for entire parameter list in structure format properly aligned)] | ||
50 | |||
51 | // return | ||
52 | typelib_TypeDescription * pReturnTypeDescr = 0; | ||
53 | if (pReturnTypeRef) | ||
54 | TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); | ||
55 | |||
56 | void * pUnoReturn = 0; | ||
57 | void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need | ||
58 | |||
59 | sal_Int32 ngpreg = 0; | ||
60 | sal_Int32 nfpreg = 0; | ||
61 | |||
62 | |||
63 | if (pReturnTypeDescr) | ||
64 | { | ||
65 | if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) | ||
66 | pUnoReturn = pRegisterReturn; // direct way for simple types | ||
67 | else // complex return via ptr (pCppReturn) | ||
68 | { | ||
69 | pCppReturn = *gpreg; | ||
70 | ngpreg++; | ||
71 | ++ovrflw; | ||
72 | |||
73 | pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) | ||
74 | ? alloca( pReturnTypeDescr->nSize ) | ||
75 | : pCppReturn); // direct way | ||
76 | } | ||
77 | } | ||
78 | // pop this | ||
79 | ngpreg++; | ||
80 | ++ovrflw; | ||
81 | |||
82 | // after handling optional return pointer and "this" | ||
83 | // make use of the space that is allocated to store all parameters in the callers stack | ||
84 | // by comying the proper registers filled with parameters to that space | ||
85 | char * pCppStack = (char *)ovrflw; | ||
86 | |||
87 | |||
88 | sal_Int32 nPos; | ||
89 | |||
90 | for ( nPos = 0; nPos < nParams; ++nPos ) | ||
91 | { | ||
92 | const typelib_MethodParameter & rParam = pParams[nPos]; | ||
93 | if (rParam.bOut) | ||
94 | { | ||
95 | if (ngpreg < 8) | ||
96 | { | ||
97 | *(sal_Int32 *)pCppStack = ((sal_Int32 *)gpreg)[ngpreg++]; | ||
98 | } | ||
99 | pCppStack += sizeof (sal_Int32); | ||
100 | } | ||
101 | else | ||
102 | { | ||
103 | switch (rParam.pTypeRef->eTypeClass) | ||
104 | { | ||
105 | case typelib_TypeClass_FLOAT: | ||
106 | if (nfpreg < 13) | ||
107 | { | ||
108 | *(float *)pCppStack = ((double *)fpreg)[nfpreg++]; | ||
109 | } | ||
110 | pCppStack += sizeof (float); | ||
111 | ngpreg += 1; | ||
112 | break; | ||
113 | case typelib_TypeClass_DOUBLE: | ||
114 | if (nfpreg < 13) | ||
115 | { | ||
116 | *(double *)pCppStack = ((double *)fpreg)[nfpreg++]; | ||
117 | } | ||
118 | pCppStack += sizeof (double); | ||
119 | ngpreg += 2; | ||
120 | break; | ||
121 | case typelib_TypeClass_UNSIGNED_HYPER: | ||
122 | case typelib_TypeClass_HYPER: | ||
123 | if (ngpreg < 8) | ||
124 | { | ||
125 | *(sal_Int32 *)pCppStack = ((sal_Int32 *)gpreg)[ngpreg++]; | ||
126 | } | ||
127 | pCppStack += sizeof (sal_Int32); | ||
128 | // fall through on purpose | ||
129 | default: | ||
130 | if (ngpreg < 8) | ||
131 | { | ||
132 | *(sal_Int32 *)pCppStack = ((sal_Int32 *)gpreg)[ngpreg++]; | ||
133 | } | ||
134 | pCppStack += sizeof (sal_Int32); | ||
135 | } | ||
136 | } | ||
137 | } | ||
138 | |||
139 | // now the stack has all of the parameters stored in it ready to be processed | ||
140 | // so we are ready to build the uno call stack | ||
141 | pCppStack = (char *)ovrflw; | ||
142 | |||
143 | // stack space | ||
144 | OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" ); | ||
145 | |||
146 | // parameters | ||
147 | void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); | ||
148 | void ** pCppArgs = pUnoArgs + nParams; | ||
149 | |||
150 | // indizes of values this have to be converted (interface conversion cpp<=>uno) | ||
151 | sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); | ||
152 | |||
153 | // type descriptions for reconversions | ||
154 | typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); | ||
155 | |||
156 | sal_Int32 nTempIndizes = 0; | ||
157 | |||
158 | for ( nPos = 0; nPos < nParams; ++nPos ) | ||
159 | { | ||
160 | const typelib_MethodParameter & rParam = pParams[nPos]; | ||
161 | typelib_TypeDescription * pParamTypeDescr = 0; | ||
162 | TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); | ||
163 | |||
164 | if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) | ||
165 | // value | ||
166 | { | ||
167 | switch (pParamTypeDescr->eTypeClass) | ||
168 | { | ||
169 | case typelib_TypeClass_BOOLEAN: | ||
170 | case typelib_TypeClass_BYTE: | ||
171 | pCppArgs[nPos] = pCppStack +3; | ||
172 | pUnoArgs[nPos] = pCppStack +3; | ||
173 | break; | ||
174 | case typelib_TypeClass_CHAR: | ||
175 | case typelib_TypeClass_SHORT: | ||
176 | case typelib_TypeClass_UNSIGNED_SHORT: | ||
177 | pCppArgs[nPos] = pCppStack +2; | ||
178 | pUnoArgs[nPos] = pCppStack +2; | ||
179 | break; | ||
180 | case typelib_TypeClass_HYPER: | ||
181 | case typelib_TypeClass_UNSIGNED_HYPER: | ||
182 | case typelib_TypeClass_DOUBLE: | ||
183 | pCppArgs[nPos] = pCppStack; | ||
184 | pUnoArgs[nPos] = pCppStack; | ||
185 | pCppStack += sizeof(sal_Int32); // extra long (two regs) | ||
186 | break; | ||
187 | default: | ||
188 | pCppArgs[nPos] = pCppStack; | ||
189 | pUnoArgs[nPos] = pCppStack; | ||
190 | } | ||
191 | // no longer needed | ||
192 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
193 | } | ||
194 | else // ptr to complex value | ref | ||
195 | { | ||
196 | pCppArgs[nPos] = *(void **)pCppStack; | ||
197 | |||
198 | if (! rParam.bIn) // is pure out | ||
199 | { | ||
200 | // uno out is unconstructed mem! | ||
201 | pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ); | ||
202 | pTempIndizes[nTempIndizes] = nPos; | ||
203 | // will be released at reconversion | ||
204 | ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; | ||
205 | } | ||
206 | // is in/inout | ||
207 | else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) | ||
208 | { | ||
209 | uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), | ||
210 | *(void **)pCppStack, pParamTypeDescr, | ||
211 | pThis->getBridge()->getCpp2Uno() ); | ||
212 | pTempIndizes[nTempIndizes] = nPos; // has to be reconverted | ||
213 | // will be released at reconversion | ||
214 | ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; | ||
215 | } | ||
216 | else // direct way | ||
217 | { | ||
218 | pUnoArgs[nPos] = *(void **)pCppStack; | ||
219 | // no longer needed | ||
220 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
221 | } | ||
222 | } | ||
223 | pCppStack += sizeof(sal_Int32); // standard parameter length | ||
224 | } | ||
225 | |||
226 | |||
227 | // ExceptionHolder | ||
228 | uno_Any aUnoExc; // Any will be constructed by callee | ||
229 | uno_Any * pUnoExc = &aUnoExc; | ||
230 | |||
231 | // invoke uno dispatch call | ||
232 | (*pThis->getUnoI()->pDispatcher)( | ||
233 | pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); | ||
234 | |||
235 | // in case an exception occurred... | ||
236 | if (pUnoExc) | ||
237 | { | ||
238 | // destruct temporary in/inout params | ||
239 | for ( ; nTempIndizes--; ) | ||
240 | { | ||
241 | sal_Int32 nIndex = pTempIndizes[nTempIndizes]; | ||
242 | |||
243 | if (pParams[nIndex].bIn) // is in/inout => was constructed | ||
244 | uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); | ||
245 | TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); | ||
246 | } | ||
247 | if (pReturnTypeDescr) | ||
248 | TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); | ||
249 | |||
250 | CPPU_CURRENT_NAMESPACE::raiseException( | ||
251 | &aUnoExc, pThis->getBridge()->getUno2Cpp() ); | ||
252 | // has to destruct the any | ||
253 | // is here for dummy | ||
254 | return typelib_TypeClass_VOID; | ||
255 | } | ||
256 | else // else no exception occurred... | ||
257 | { | ||
258 | // temporary params | ||
259 | for ( ; nTempIndizes--; ) | ||
260 | { | ||
261 | sal_Int32 nIndex = pTempIndizes[nTempIndizes]; | ||
262 | typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; | ||
263 | |||
264 | if (pParams[nIndex].bOut) // inout/out | ||
265 | { | ||
266 | // convert and assign | ||
267 | uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); | ||
268 | uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, | ||
269 | pThis->getBridge()->getUno2Cpp() ); | ||
270 | } | ||
271 | // destroy temp uno param | ||
272 | uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); | ||
273 | |||
274 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
275 | } | ||
276 | // return | ||
277 | if (pCppReturn) // has complex return | ||
278 | { | ||
279 | if (pUnoReturn != pCppReturn) // needs reconversion | ||
280 | { | ||
281 | uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, | ||
282 | pThis->getBridge()->getUno2Cpp() ); | ||
283 | // destroy temp uno return | ||
284 | uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); | ||
285 | } | ||
286 | // complex return ptr is set to return reg | ||
287 | *(void **)pRegisterReturn = pCppReturn; | ||
288 | } | ||
289 | if (pReturnTypeDescr) | ||
290 | { | ||
291 | typelib_TypeClass eRet = (typelib_TypeClass)pReturnTypeDescr->eTypeClass; | ||
292 | TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); | ||
293 | return eRet; | ||
294 | } | ||
295 | else | ||
296 | return typelib_TypeClass_VOID; | ||
297 | } | ||
298 | } | ||
299 | |||
300 | |||
301 | //================================================================================================== | ||
302 | static typelib_TypeClass cpp_mediate( | ||
303 | sal_Int32 nFunctionIndex, | ||
304 | sal_Int32 nVtableOffset, | ||
305 | void ** gpreg, void ** fpreg, void ** ovrflw, | ||
306 | sal_Int64 * pRegisterReturn /* space for register return */ ) | ||
307 | { | ||
308 | OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); | ||
309 | |||
310 | // gpreg: [ret *], this, [other gpr params] | ||
311 | // fpreg: [fpr params] | ||
312 | // ovrflw: [gpr or fpr params (in space allocated for all params properly aligned)] | ||
313 | |||
314 | void * pThis; | ||
315 | if( nFunctionIndex & 0x80000000 ) | ||
316 | { | ||
317 | nFunctionIndex &= 0x7fffffff; | ||
318 | pThis = gpreg[1]; | ||
319 | } | ||
320 | else | ||
321 | { | ||
322 | pThis = gpreg[0]; | ||
323 | } | ||
324 | |||
325 | pThis = static_cast< char * >(pThis) - nVtableOffset; | ||
326 | bridges::cpp_uno::shared::CppInterfaceProxy * pCppI | ||
327 | = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(pThis); | ||
328 | |||
329 | |||
330 | typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); | ||
331 | |||
332 | OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); | ||
333 | if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) | ||
334 | { | ||
335 | throw RuntimeException( | ||
336 | rtl::OUString( "illegal vtable index!" ), | ||
337 | (XInterface *)pThis ); | ||
338 | } | ||
339 | |||
340 | // determine called method | ||
341 | sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; | ||
342 | OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); | ||
343 | |||
344 | TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); | ||
345 | |||
346 | typelib_TypeClass eRet; | ||
347 | switch (aMemberDescr.get()->eTypeClass) | ||
348 | { | ||
349 | case typelib_TypeClass_INTERFACE_ATTRIBUTE: | ||
350 | { | ||
351 | if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex) | ||
352 | { | ||
353 | // is GET method | ||
354 | eRet = cpp2uno_call( | ||
355 | pCppI, aMemberDescr.get(), | ||
356 | ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef, | ||
357 | 0, 0, // no params | ||
358 | gpreg, fpreg, ovrflw, pRegisterReturn ); | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | // is SET method | ||
363 | typelib_MethodParameter aParam; | ||
364 | aParam.pTypeRef = | ||
365 | ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; | ||
366 | aParam.bIn = sal_True; | ||
367 | aParam.bOut = sal_False; | ||
368 | |||
369 | eRet = cpp2uno_call( | ||
370 | pCppI, aMemberDescr.get(), | ||
371 | 0, // indicates void return | ||
372 | 1, &aParam, | ||
373 | gpreg, fpreg, ovrflw, pRegisterReturn ); | ||
374 | } | ||
375 | break; | ||
376 | } | ||
377 | case typelib_TypeClass_INTERFACE_METHOD: | ||
378 | { | ||
379 | // is METHOD | ||
380 | switch (nFunctionIndex) | ||
381 | { | ||
382 | case 1: // acquire() | ||
383 | pCppI->acquireProxy(); // non virtual call! | ||
384 | eRet = typelib_TypeClass_VOID; | ||
385 | break; | ||
386 | case 2: // release() | ||
387 | pCppI->releaseProxy(); // non virtual call! | ||
388 | eRet = typelib_TypeClass_VOID; | ||
389 | break; | ||
390 | case 0: // queryInterface() opt | ||
391 | { | ||
392 | typelib_TypeDescription * pTD = 0; | ||
393 | TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( gpreg[2] )->getTypeLibType() ); | ||
394 | if (pTD) | ||
395 | { | ||
396 | XInterface * pInterface = 0; | ||
397 | (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( | ||
398 | pCppI->getBridge()->getCppEnv(), | ||
399 | (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); | ||
400 | |||
401 | if (pInterface) | ||
402 | { | ||
403 | ::uno_any_construct( | ||
404 | reinterpret_cast< uno_Any * >( gpreg[0] ), | ||
405 | &pInterface, pTD, cpp_acquire ); | ||
406 | pInterface->release(); | ||
407 | TYPELIB_DANGER_RELEASE( pTD ); | ||
408 | *(void **)pRegisterReturn = gpreg[0]; | ||
409 | eRet = typelib_TypeClass_ANY; | ||
410 | break; | ||
411 | } | ||
412 | TYPELIB_DANGER_RELEASE( pTD ); | ||
413 | } | ||
414 | } // else perform queryInterface() | ||
415 | default: | ||
416 | eRet = cpp2uno_call( | ||
417 | pCppI, aMemberDescr.get(), | ||
418 | ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef, | ||
419 | ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams, | ||
420 | ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams, | ||
421 | gpreg, fpreg, ovrflw, pRegisterReturn ); | ||
422 | } | ||
423 | break; | ||
424 | } | ||
425 | default: | ||
426 | { | ||
427 | throw RuntimeException( | ||
428 | rtl::OUString( "no member description found!" ), | ||
429 | (XInterface *)pThis ); | ||
430 | } | ||
431 | } | ||
432 | |||
433 | return eRet; | ||
434 | } | ||
435 | |||
436 | //================================================================================================== | ||
437 | /** | ||
438 | * is called on incoming vtable calls | ||
439 | * (called by asm snippets) | ||
440 | */ | ||
441 | static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpregptr, void** fpregptr, void** ovrflw) | ||
442 | { | ||
443 | sal_Int32 gpreg[8]; | ||
444 | double fpreg[13]; | ||
445 | |||
446 | // FIXME: why are we restoring the volatile ctr register here | ||
447 | sal_Int32 ctrsave = ((sal_Int32*)gpregptr)[-1]; | ||
448 | |||
449 | memcpy( gpreg, gpregptr, 32); | ||
450 | memcpy( fpreg, fpregptr, 104); | ||
451 | |||
452 | volatile long nRegReturn[2]; | ||
453 | |||
454 | // sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; | ||
455 | |||
456 | typelib_TypeClass aType = | ||
457 | cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); | ||
458 | |||
459 | // FIXME: why are we restoring the volatile ctr register here | ||
460 | // FIXME: and why are we putting back the values for r4, r5, and r6 as well | ||
461 | // FIXME: this makes no sense to me, all of these registers are volatile! | ||
462 | __asm__( "lwz r4, %0\n\t" | ||
463 | "mtctr r4\n\t" | ||
464 | "lwz r4, %1\n\t" | ||
465 | "lwz r5, %2\n\t" | ||
466 | "lwz r6, %3\n\t" | ||
467 | : : "m"(ctrsave), "m"(gpreg[1]), "m"(gpreg[2]), "m"(gpreg[3]) ); | ||
468 | |||
469 | switch( aType ) | ||
470 | { | ||
471 | |||
472 | // move return value into register space | ||
473 | // (will be loaded by machine code snippet) | ||
474 | |||
475 | case typelib_TypeClass_BOOLEAN: | ||
476 | case typelib_TypeClass_BYTE: | ||
477 | __asm__( "lbz r3,%0\n\t" : : | ||
478 | "m"(nRegReturn[0]) ); | ||
479 | break; | ||
480 | |||
481 | case typelib_TypeClass_CHAR: | ||
482 | case typelib_TypeClass_SHORT: | ||
483 | case typelib_TypeClass_UNSIGNED_SHORT: | ||
484 | __asm__( "lhz r3,%0\n\t" : : | ||
485 | "m"(nRegReturn[0]) ); | ||
486 | break; | ||
487 | |||
488 | case typelib_TypeClass_FLOAT: | ||
489 | __asm__( "lfs f1,%0\n\t" : : | ||
490 | "m" (*((float*)nRegReturn)) ); | ||
491 | break; | ||
492 | |||
493 | case typelib_TypeClass_DOUBLE: | ||
494 | __asm__( "lfd f1,%0\n\t" : : | ||
495 | "m" (*((double*)nRegReturn)) ); | ||
496 | break; | ||
497 | |||
498 | case typelib_TypeClass_HYPER: | ||
499 | case typelib_TypeClass_UNSIGNED_HYPER: | ||
500 | __asm__( "lwz r4,%0\n\t" : : | ||
501 | "m"(nRegReturn[1]) ); // fall through | ||
502 | |||
503 | default: | ||
504 | __asm__( "lwz r3,%0\n\t" : : | ||
505 | "m"(nRegReturn[0]) ); | ||
506 | break; | ||
507 | } | ||
508 | } | ||
509 | |||
510 | |||
511 | int const codeSnippetSize = 136; | ||
512 | |||
513 | unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, | ||
514 | sal_Int32 vtableOffset, bool simpleRetType ) | ||
515 | { | ||
516 | if (! simpleRetType ) | ||
517 | functionIndex |= 0x80000000; | ||
518 | |||
519 | // OSL_ASSERT( sizeof (long) == 4 ); | ||
520 | |||
521 | // FIXME: why are we leaving an 8k gap in the stack here | ||
522 | // FIXME: is this to allow room for signal handling frames? | ||
523 | // FIXME: seems like overkill here but this is what was done for Mac OSX for gcc2 | ||
524 | // FIXME: also why no saving of the non-volatile CR pieces here, to be safe | ||
525 | // FIXME: we probably should | ||
526 | |||
527 | /* generate this code */ | ||
528 | |||
529 | // # so first save gpr 3 to gpr 10 (aligned to 4) | ||
530 | // stw r3, -8000(r1) | ||
531 | // stw r4, -7996(r1) | ||
532 | // stw r5, -7992(r1) | ||
533 | // stw r6, -7988(r1) | ||
534 | // stw r7, -7984(r1) | ||
535 | // stw r8, -7980(r1) | ||
536 | // stw r9, -7976(r1) | ||
537 | // stw r10,-7972(r1) | ||
538 | |||
539 | // # next save fpr 1 to fpr 13 (aligned to 8) | ||
540 | // stfd f1, -7968(r1) | ||
541 | // stfd f2, -7960(r1) | ||
542 | // stfd f3, -7952(r1) | ||
543 | // stfd f4, -7944(r1) | ||
544 | // stfd f5, -7936(r1) | ||
545 | // stfd f6, -7928(r1) | ||
546 | // stfd f7, -7920(r1) | ||
547 | // stfd f8, -7912(r1) | ||
548 | // stfd f9, -7904(r1) | ||
549 | // stfd f10,-7896(r1) | ||
550 | // stfd f11,-7888(r1) | ||
551 | // stfd f12,-7880(r1) | ||
552 | // stfd f13,-7872(r1) | ||
553 | |||
554 | // FIXME: ctr is volatile, while are we saving it and not CR? | ||
555 | // mfctr r3 | ||
556 | // stw r3, -8004(r1) | ||
557 | |||
558 | // # now here is where cpp_vtable_call must go | ||
559 | // lis r3,0xdead | ||
560 | // ori r3,r3,0xbeef | ||
561 | // mtctr r3 | ||
562 | |||
563 | // # now load up the functionIndex number | ||
564 | // lis r3, 0xdead | ||
565 | // ori r3,r3,0xbeef | ||
566 | |||
567 | // # now load up the vtableOffset | ||
568 | // lis r4, 0xdead | ||
569 | // ori r4,r4,0xbeef | ||
570 | |||
571 | // #now load up the pointer to the saved gpr registers | ||
572 | // addi r5,r1,-8000 | ||
573 | |||
574 | // #now load up the pointer to the saved fpr registers | ||
575 | // addi r6,r1,-7968 | ||
576 | |||
577 | // #now load up the pointer to the overflow call stack | ||
578 | // addi r7,r1,24 # frame pointer plus 24 | ||
579 | |||
580 | // bctr | ||
581 | |||
582 | unsigned long * p = (unsigned long *) code; | ||
583 | |||
584 | * p++ = 0x9061e0c0; | ||
585 | * p++ = 0x9081e0c4; | ||
586 | * p++ = 0x90a1e0c8; | ||
587 | * p++ = 0x90c1e0cc; | ||
588 | * p++ = 0x90e1e0d0; | ||
589 | * p++ = 0x9101e0d4; | ||
590 | * p++ = 0x9121e0d8; | ||
591 | * p++ = 0x9141e0dc; | ||
592 | * p++ = 0xd821e0e0; | ||
593 | * p++ = 0xd841e0e8; | ||
594 | * p++ = 0xd861e0f0; | ||
595 | * p++ = 0xd881e0f8; | ||
596 | * p++ = 0xd8a1e100; | ||
597 | * p++ = 0xd8c1e108; | ||
598 | * p++ = 0xd8e1e110; | ||
599 | * p++ = 0xd901e118; | ||
600 | * p++ = 0xd921e120; | ||
601 | * p++ = 0xd941e128; | ||
602 | * p++ = 0xd961e130; | ||
603 | * p++ = 0xd981e138; | ||
604 | * p++ = 0xd9a1e140; | ||
605 | * p++ = 0x7c6902a6; | ||
606 | * p++ = 0x9061e0bc; | ||
607 | * p++ = 0x3c600000 | (((unsigned long)cpp_vtable_call) >> 16); | ||
608 | * p++ = 0x60630000 | (((unsigned long)cpp_vtable_call) & 0x0000FFFF); | ||
609 | * p++ = 0x7c6903a6; | ||
610 | * p++ = 0x3c600000 | (((unsigned long)functionIndex) >> 16); | ||
611 | * p++ = 0x60630000 | (((unsigned long)functionIndex) & 0x0000FFFF); | ||
612 | * p++ = 0x3c800000 | (((unsigned long)vtableOffset) >> 16); | ||
613 | * p++ = 0x60840000 | (((unsigned long)vtableOffset) & 0x0000FFFF); | ||
614 | * p++ = 0x38a1e0c0; | ||
615 | * p++ = 0x38c1e0e0; | ||
616 | * p++ = 0x38e10018; | ||
617 | * p++ = 0x4e800420; | ||
618 | |||
619 | return (code + codeSnippetSize); | ||
620 | |||
621 | } | ||
622 | |||
623 | |||
624 | } | ||
625 | |||
626 | void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const * bptr, unsigned char const * eptr) | ||
627 | { | ||
628 | int const lineSize = 32; | ||
629 | for (unsigned char const * p = bptr; p < eptr + lineSize; p += lineSize) { | ||
630 | __asm__ volatile ("dcbst 0, %0" : : "r"(p) : "memory"); | ||
631 | } | ||
632 | __asm__ volatile ("sync" : : : "memory"); | ||
633 | for (unsigned char const * p = bptr; p < eptr + lineSize; p += lineSize) { | ||
634 | __asm__ volatile ("icbi 0, %0" : : "r"(p) : "memory"); | ||
635 | } | ||
636 | __asm__ volatile ("isync" : : : "memory"); | ||
637 | } | ||
638 | |||
639 | struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; | ||
640 | |||
641 | bridges::cpp_uno::shared::VtableFactory::Slot * | ||
642 | bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) | ||
643 | { | ||
644 | return static_cast< Slot * >(block) + 2; | ||
645 | } | ||
646 | |||
647 | sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( | ||
648 | sal_Int32 slotCount) | ||
649 | { | ||
650 | return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; | ||
651 | } | ||
652 | |||
653 | bridges::cpp_uno::shared::VtableFactory::Slot * | ||
654 | bridges::cpp_uno::shared::VtableFactory::initializeBlock( | ||
655 | void * block, sal_Int32 slotCount) | ||
656 | { | ||
657 | Slot * slots = mapBlockToVtable(block); | ||
658 | slots[-2].fn = 0; | ||
659 | slots[-1].fn = 0; | ||
660 | return slots + slotCount; | ||
661 | } | ||
662 | |||
663 | unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( | ||
664 | Slot ** slots, unsigned char * code, | ||
665 | typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, | ||
666 | sal_Int32 functionCount, sal_Int32 vtableOffset) | ||
667 | { | ||
668 | (*slots) -= functionCount; | ||
669 | Slot * s = *slots; | ||
670 | |||
671 | // fprintf(stderr, "in addLocalFunctions functionOffset is %x\n",functionOffset); | ||
672 | // fprintf(stderr, "in addLocalFunctions vtableOffset is %x\n",vtableOffset); | ||
673 | // fflush(stderr); | ||
674 | |||
675 | for (sal_Int32 i = 0; i < type->nMembers; ++i) { | ||
676 | typelib_TypeDescription * member = 0; | ||
677 | TYPELIB_DANGER_GET(&member, type->ppMembers[i]); | ||
678 | OSL_ASSERT(member != 0); | ||
679 | switch (member->eTypeClass) { | ||
680 | case typelib_TypeClass_INTERFACE_ATTRIBUTE: | ||
681 | // Getter: | ||
682 | (s++)->fn = code; | ||
683 | code = codeSnippet( | ||
684 | code, functionOffset++, vtableOffset, | ||
685 | bridges::cpp_uno::shared::isSimpleType( | ||
686 | reinterpret_cast< | ||
687 | typelib_InterfaceAttributeTypeDescription * >( | ||
688 | member)->pAttributeTypeRef)); | ||
689 | |||
690 | // Setter: | ||
691 | if (!reinterpret_cast< | ||
692 | typelib_InterfaceAttributeTypeDescription * >( | ||
693 | member)->bReadOnly) | ||
694 | { | ||
695 | (s++)->fn = code; | ||
696 | code = codeSnippet(code, functionOffset++, vtableOffset, true); | ||
697 | } | ||
698 | break; | ||
699 | |||
700 | case typelib_TypeClass_INTERFACE_METHOD: | ||
701 | (s++)->fn = code; | ||
702 | code = codeSnippet( | ||
703 | code, functionOffset++, vtableOffset, | ||
704 | bridges::cpp_uno::shared::isSimpleType( | ||
705 | reinterpret_cast< | ||
706 | typelib_InterfaceMethodTypeDescription * >( | ||
707 | member)->pReturnTypeRef)); | ||
708 | break; | ||
709 | |||
710 | default: | ||
711 | OSL_ASSERT(false); | ||
712 | break; | ||
713 | } | ||
714 | TYPELIB_DANGER_RELEASE(member); | ||
715 | } | ||
716 | return code; | ||
717 | } | ||
718 | |||
719 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx deleted file mode 100644 index a4ba995c5a23..000000000000 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx +++ /dev/null | |||
@@ -1,277 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | |||
21 | #include <stdio.h> | ||
22 | #include <dlfcn.h> | ||
23 | #include <cxxabi.h> | ||
24 | #include <boost/unordered_map.hpp> | ||
25 | |||
26 | #include <rtl/strbuf.hxx> | ||
27 | #include <rtl/ustrbuf.hxx> | ||
28 | #include <osl/diagnose.h> | ||
29 | #include <osl/mutex.hxx> | ||
30 | |||
31 | #include <com/sun/star/uno/genfunc.hxx> | ||
32 | #include <typelib/typedescription.hxx> | ||
33 | #include <uno/any2.h> | ||
34 | |||
35 | #include "share.hxx" | ||
36 | |||
37 | |||
38 | using namespace ::std; | ||
39 | using namespace ::osl; | ||
40 | using namespace ::rtl; | ||
41 | using namespace ::com::sun::star::uno; | ||
42 | using namespace ::__cxxabiv1; | ||
43 | |||
44 | |||
45 | namespace CPPU_CURRENT_NAMESPACE | ||
46 | { | ||
47 | |||
48 | void dummy_can_throw_anything( char const * ) | ||
49 | { | ||
50 | } | ||
51 | |||
52 | //================================================================================================== | ||
53 | static OUString toUNOname( char const * p ) SAL_THROW(()) | ||
54 | { | ||
55 | #ifdef DEBUG | ||
56 | char const * start = p; | ||
57 | #endif | ||
58 | |||
59 | // example: N3com3sun4star4lang24IllegalArgumentExceptionE | ||
60 | |||
61 | OUStringBuffer buf( 64 ); | ||
62 | OSL_ASSERT( 'N' == *p ); | ||
63 | ++p; // skip N | ||
64 | |||
65 | while ('E' != *p) | ||
66 | { | ||
67 | // read chars count | ||
68 | long n = (*p++ - '0'); | ||
69 | while ('0' <= *p && '9' >= *p) | ||
70 | { | ||
71 | n *= 10; | ||
72 | n += (*p++ - '0'); | ||
73 | } | ||
74 | buf.appendAscii( p, n ); | ||
75 | p += n; | ||
76 | if ('E' != *p) | ||
77 | buf.append( (sal_Unicode)'.' ); | ||
78 | } | ||
79 | |||
80 | #ifdef DEBUG | ||
81 | OUString ret( buf.makeStringAndClear() ); | ||
82 | OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); | ||
83 | fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() ); | ||
84 | return ret; | ||
85 | #else | ||
86 | return buf.makeStringAndClear(); | ||
87 | #endif | ||
88 | } | ||
89 | |||
90 | //================================================================================================== | ||
91 | class RTTI | ||
92 | { | ||
93 | typedef boost::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map; | ||
94 | |||
95 | Mutex m_mutex; | ||
96 | t_rtti_map m_rttis; | ||
97 | t_rtti_map m_generatedRttis; | ||
98 | |||
99 | void * m_hApp; | ||
100 | |||
101 | public: | ||
102 | RTTI() SAL_THROW(()); | ||
103 | ~RTTI() SAL_THROW(()); | ||
104 | |||
105 | type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW(()); | ||
106 | }; | ||
107 | //__________________________________________________________________________________________________ | ||
108 | RTTI::RTTI() SAL_THROW(()) | ||
109 | : m_hApp( dlopen( 0, RTLD_LAZY ) ) | ||
110 | { | ||
111 | } | ||
112 | //__________________________________________________________________________________________________ | ||
113 | RTTI::~RTTI() SAL_THROW(()) | ||
114 | { | ||
115 | dlclose( m_hApp ); | ||
116 | } | ||
117 | |||
118 | //__________________________________________________________________________________________________ | ||
119 | type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW(()) | ||
120 | { | ||
121 | type_info * rtti; | ||
122 | |||
123 | OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; | ||
124 | |||
125 | MutexGuard guard( m_mutex ); | ||
126 | t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); | ||
127 | if (iFind == m_rttis.end()) | ||
128 | { | ||
129 | // RTTI symbol | ||
130 | OStringBuffer buf( 64 ); | ||
131 | buf.append( "_ZTIN" ); | ||
132 | sal_Int32 index = 0; | ||
133 | do | ||
134 | { | ||
135 | OUString token( unoName.getToken( 0, '.', index ) ); | ||
136 | buf.append( token.getLength() ); | ||
137 | OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) ); | ||
138 | buf.append( c_token ); | ||
139 | } | ||
140 | while (index >= 0); | ||
141 | buf.append( 'E' ); | ||
142 | |||
143 | OString symName( buf.makeStringAndClear() ); | ||
144 | rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); | ||
145 | |||
146 | if (rtti) | ||
147 | { | ||
148 | pair< t_rtti_map::iterator, bool > insertion( | ||
149 | m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); | ||
150 | OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" ); | ||
151 | } | ||
152 | else | ||
153 | { | ||
154 | // try to lookup the symbol in the generated rtti map | ||
155 | t_rtti_map::const_iterator iiFind( m_generatedRttis.find( unoName ) ); | ||
156 | if (iiFind == m_generatedRttis.end()) | ||
157 | { | ||
158 | // we must generate it ! | ||
159 | // symbol and rtti-name is nearly identical, | ||
160 | // the symbol is prefixed with _ZTI | ||
161 | char const * rttiName = symName.getStr() +4; | ||
162 | #ifdef DEBUG | ||
163 | fprintf( stderr,"generated rtti for %s\n", rttiName ); | ||
164 | #endif | ||
165 | if (pTypeDescr->pBaseTypeDescription) | ||
166 | { | ||
167 | // ensure availability of base | ||
168 | type_info * base_rtti = getRTTI( | ||
169 | (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription ); | ||
170 | rtti = new __si_class_type_info( | ||
171 | strdup( rttiName ), (__class_type_info *)base_rtti ); | ||
172 | } | ||
173 | else | ||
174 | { | ||
175 | // this class has no base class | ||
176 | rtti = new __class_type_info( strdup( rttiName ) ); | ||
177 | } | ||
178 | |||
179 | pair< t_rtti_map::iterator, bool > insertion( | ||
180 | m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); | ||
181 | OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); | ||
182 | } | ||
183 | else // taking already generated rtti | ||
184 | { | ||
185 | rtti = iiFind->second; | ||
186 | } | ||
187 | } | ||
188 | } | ||
189 | else | ||
190 | { | ||
191 | rtti = iFind->second; | ||
192 | } | ||
193 | |||
194 | return rtti; | ||
195 | } | ||
196 | |||
197 | //-------------------------------------------------------------------------------------------------- | ||
198 | static void deleteException( void * pExc ) | ||
199 | { | ||
200 | __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); | ||
201 | typelib_TypeDescription * pTD = 0; | ||
202 | OUString unoName( toUNOname( header->exceptionType->name() ) ); | ||
203 | ::typelib_typedescription_getByName( &pTD, unoName.pData ); | ||
204 | OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" ); | ||
205 | if (pTD) | ||
206 | { | ||
207 | ::uno_destructData( pExc, pTD, cpp_release ); | ||
208 | ::typelib_typedescription_release( pTD ); | ||
209 | } | ||
210 | } | ||
211 | |||
212 | //================================================================================================== | ||
213 | void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) | ||
214 | { | ||
215 | void * pCppExc; | ||
216 | type_info * rtti; | ||
217 | |||
218 | { | ||
219 | // construct cpp exception object | ||
220 | typelib_TypeDescription * pTypeDescr = 0; | ||
221 | TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType ); | ||
222 | OSL_ASSERT( pTypeDescr ); | ||
223 | if (! pTypeDescr) | ||
224 | terminate(); | ||
225 | |||
226 | pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); | ||
227 | ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); | ||
228 | |||
229 | // destruct uno exception | ||
230 | ::uno_any_destruct( pUnoExc, 0 ); | ||
231 | // avoiding locked counts | ||
232 | static RTTI * s_rtti = 0; | ||
233 | if (! s_rtti) | ||
234 | { | ||
235 | MutexGuard guard( Mutex::getGlobalMutex() ); | ||
236 | if (! s_rtti) | ||
237 | { | ||
238 | #ifdef LEAK_STATIC_DATA | ||
239 | s_rtti = new RTTI(); | ||
240 | #else | ||
241 | static RTTI rtti_data; | ||
242 | s_rtti = &rtti_data; | ||
243 | #endif | ||
244 | } | ||
245 | } | ||
246 | rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); | ||
247 | TYPELIB_DANGER_RELEASE( pTypeDescr ); | ||
248 | OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); | ||
249 | if (! rtti) | ||
250 | terminate(); | ||
251 | } | ||
252 | |||
253 | __cxa_throw( pCppExc, rtti, deleteException ); | ||
254 | } | ||
255 | |||
256 | //================================================================================================== | ||
257 | void fillUnoException( __cxa_exception * header, uno_Any * pExc, uno_Mapping * pCpp2Uno ) | ||
258 | { | ||
259 | OSL_ENSURE( header, "### no exception header!!!" ); | ||
260 | if (! header) | ||
261 | terminate(); | ||
262 | |||
263 | typelib_TypeDescription * pExcTypeDescr = 0; | ||
264 | OUString unoName( toUNOname( header->exceptionType->name() ) ); | ||
265 | ::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); | ||
266 | OSL_ENSURE( pExcTypeDescr, "### can not get type description for exception!!!" ); | ||
267 | if (! pExcTypeDescr) | ||
268 | terminate(); | ||
269 | |||
270 | // construct uno exception any | ||
271 | ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno ); | ||
272 | ::typelib_typedescription_release( pExcTypeDescr ); | ||
273 | } | ||
274 | |||
275 | } | ||
276 | |||
277 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx deleted file mode 100644 index 0bc37f6ad4bf..000000000000 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | #include "uno/mapping.h" | ||
21 | |||
22 | #include <typeinfo> | ||
23 | #include <exception> | ||
24 | #include <cstddef> | ||
25 | |||
26 | namespace CPPU_CURRENT_NAMESPACE | ||
27 | { | ||
28 | |||
29 | void dummy_can_throw_anything( char const * ); | ||
30 | |||
31 | |||
32 | // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h | ||
33 | |||
34 | struct _Unwind_Exception | ||
35 | { | ||
36 | unsigned exception_class __attribute__((__mode__(__DI__))); | ||
37 | void * exception_cleanup; | ||
38 | unsigned private_1 __attribute__((__mode__(__word__))); | ||
39 | unsigned private_2 __attribute__((__mode__(__word__))); | ||
40 | } __attribute__((__aligned__)); | ||
41 | |||
42 | struct __cxa_exception | ||
43 | { | ||
44 | ::std::type_info *exceptionType; | ||
45 | void (*exceptionDestructor)(void *); | ||
46 | |||
47 | ::std::unexpected_handler unexpectedHandler; | ||
48 | ::std::terminate_handler terminateHandler; | ||
49 | |||
50 | __cxa_exception *nextException; | ||
51 | |||
52 | int handlerCount; | ||
53 | |||
54 | int handlerSwitchValue; | ||
55 | const unsigned char *actionRecord; | ||
56 | const unsigned char *languageSpecificData; | ||
57 | void *catchTemp; | ||
58 | void *adjustedPtr; | ||
59 | |||
60 | _Unwind_Exception unwindHeader; | ||
61 | }; | ||
62 | |||
63 | extern "C" void *__cxa_allocate_exception( | ||
64 | std::size_t thrown_size ) throw(); | ||
65 | extern "C" void __cxa_throw ( | ||
66 | void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); | ||
67 | |||
68 | struct __cxa_eh_globals | ||
69 | { | ||
70 | __cxa_exception *caughtExceptions; | ||
71 | unsigned int uncaughtExceptions; | ||
72 | }; | ||
73 | extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); | ||
74 | |||
75 | // ----- | ||
76 | |||
77 | //================================================================================================== | ||
78 | void raiseException( | ||
79 | uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); | ||
80 | //================================================================================================== | ||
81 | void fillUnoException( | ||
82 | __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); | ||
83 | } | ||
84 | |||
85 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx deleted file mode 100644 index 0f5e0bc0e683..000000000000 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx +++ /dev/null | |||
@@ -1,636 +0,0 @@ | |||
1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
2 | /* | ||
3 | * This file is part of the LibreOffice project. | ||
4 | * | ||
5 | * This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
8 | * | ||
9 | * This file incorporates work covered by the following license notice: | ||
10 | * | ||
11 | * Licensed to the Apache Software Foundation (ASF) under one or more | ||
12 | * contributor license agreements. See the NOTICE file distributed | ||
13 | * with this work for additional information regarding copyright | ||
14 | * ownership. The ASF licenses this file to you under the Apache | ||
15 | * License, Version 2.0 (the "License"); you may not use this file | ||
16 | * except in compliance with the License. You may obtain a copy of | ||
17 | * the License at http://www.apache.org/licenses/LICENSE-2.0 . | ||
18 | */ | ||
19 | |||
20 | |||
21 | #include <sys/types.h> | ||
22 | #include <sys/malloc.h> | ||
23 | |||
24 | #include <com/sun/star/uno/genfunc.hxx> | ||
25 | #include <uno/data.h> | ||
26 | |||
27 | #include "bridges/cpp_uno/shared/bridge.hxx" | ||
28 | #include "bridges/cpp_uno/shared/types.hxx" | ||
29 | #include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" | ||
30 | #include "bridges/cpp_uno/shared/vtables.hxx" | ||
31 | |||
32 | #include "share.hxx" | ||
33 | |||
34 | |||
35 | using namespace ::rtl; | ||
36 | using namespace ::com::sun::star::uno; | ||
37 | |||
38 | namespace | ||
39 | { | ||
40 | |||
41 | //================================================================================================== | ||
42 | static void callVirtualMethod( | ||
43 | void * pAdjustedThisPtr, | ||
44 | sal_Int32 nVtableIndex, | ||
45 | void * pRegisterReturn, | ||
46 | typelib_TypeClass eReturnType, | ||
47 | char * pPT, | ||
48 | sal_Int32 * pStackLongs, | ||
49 | sal_Int32 /* nStackLongs */) | ||
50 | { | ||
51 | |||
52 | // parameter list is mixed list of * and values | ||
53 | // reference parameters are pointers | ||
54 | |||
55 | // the basic idea here is to use gpr[8] as a storage area for | ||
56 | // the future values of registers r3 to r10 needed for the call, | ||
57 | // and similarly fpr[13] as a storage area for the future values | ||
58 | // of floating point registers f1 to f13 | ||
59 | |||
60 | unsigned long * mfunc; // actual function to be invoked | ||
61 | int gpr[8]; // storage for gpregisters, map to r3-r10 | ||
62 | int off; // offset used to find function | ||
63 | double fpr[13]; // storage for fpregisters, map to f1-f13 | ||
64 | int n; // number of gprs mapped so far | ||
65 | int f; // number of fprs mapped so far | ||
66 | volatile long *p; // pointer to parameter overflow area | ||
67 | int c; // character of parameter type being decoded | ||
68 | volatile double dret; // temporary function return values | ||
69 | volatile int iret, iret2; | ||
70 | |||
71 | // Because of the Power PC calling conventions we could be passing | ||
72 | // parameters in both register types and on the stack. To create the | ||
73 | // stack parameter area we need we now simply allocate local | ||
74 | // variable storage param[] that is at least the size of the parameter stack | ||
75 | // (more than enough space) which we can overwrite the parameters into. | ||
76 | |||
77 | // Note: This keeps us from having to decode the signature twice and | ||
78 | // prevents problems with later local variables. | ||
79 | |||
80 | // FIXME: I do not believe the following is true but we will keep the | ||
81 | // FIXME: extra space just to be safe until proven otherwise | ||
82 | |||
83 | // Note: could require up to 2*nStackLongs words of parameter stack area | ||
84 | // if the call has many float parameters (i.e. floats take up only 1 | ||
85 | // word on the stack but take 2 words in parameter area in the | ||
86 | // stack frame . | ||
87 | |||
88 | |||
89 | // unsigned long param[(2*nStackLongs)]; | ||
90 | |||
91 | /* now begin to load the C++ function arguments into storage */ | ||
92 | n = 0; | ||
93 | f = 0; | ||
94 | |||
95 | |||
96 | /* set up a pointer to the stack parameter area */ | ||
97 | __asm__ ( "addi %0,r1,24" : "=r" (p) : /* no inputs */ ); | ||
98 | |||
99 | // #i94421#, work around compiler error: | ||
100 | volatile long * pCopy = p; | ||
101 | (void) pCopy; // avoid warning about unused variable | ||
102 | |||
103 | // never called | ||
104 | // if (! pAdjustedThisPtr )CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something | ||
105 | |||
106 | |||
107 | // now we need to parse the entire signature string | ||
108 | // until we get the END indicator | ||
109 | |||
110 | // treat complex return pointer like any other parameter | ||
111 | |||
112 | // parse the argument list up to the ending ) | ||
113 | |||
114 | while (*pPT != 'X') { | ||
115 | c = *pPT; | ||
116 | switch (c) { | ||
117 | |||
118 | case 'D': /* type is double */ | ||
119 | if (f < 13) { | ||
120 | fpr[f++] = *((double *)pStackLongs); /* store in register */ | ||
121 | n+=2; | ||
122 | p+=2; | ||
123 | } else { | ||
124 | *p++ = *pStackLongs; /* or on the parameter stack */ | ||
125 | *p++ = *(pStackLongs + 1); | ||
126 | } | ||
127 | pStackLongs += 2; | ||
128 | break; | ||
129 | |||
130 | case 'F': /* type is float */ | ||
131 | /* floats are stored as 1 32 bit word on param stack */ | ||
132 | if (f < 13) { | ||
133 | fpr[f++] = *((float *)pStackLongs); | ||
134 | n+=1; | ||
135 | p++; | ||
136 | } else { | ||
137 | *((float *)p) = *((float *)pStackLongs); | ||
138 | p += 1; | ||
139 | } | ||
140 | pStackLongs += 1; | ||
141 | break; | ||
142 | |||
143 | case 'H': /* type is long long */ | ||
144 | if (n < 8) | ||
145 | { | ||
146 | gpr[n++] = *pStackLongs; | ||
147 | p++; | ||
148 | } | ||
149 | else | ||
150 | *p++ = *pStackLongs; | ||
151 | if(n < 8) | ||
152 | { | ||
153 | gpr[n++] = *(pStackLongs+1); | ||
154 | p++; | ||
155 | } | ||
156 | else | ||
157 | *p++ = *(pStackLongs+1); | ||
158 | pStackLongs += 2; | ||
159 | break; | ||
160 | |||
161 | case 'S': | ||
162 | if (n < 8) { | ||
163 | gpr[n++] = *((unsigned short*)pStackLongs); | ||
164 | p++; | ||
165 | } else { | ||
166 | *p++ = *((unsigned short *)pStackLongs); | ||
167 | } | ||
168 | pStackLongs += 1; | ||
169 | break; | ||
170 | |||
171 | case 'B': | ||
172 | if (n < 8) { | ||
173 | gpr[n++] = *((char *)pStackLongs); | ||
174 | p++; | ||
175 | } else { | ||
176 | *p++ = *((char *)pStackLongs); | ||
177 | } | ||
178 | pStackLongs += 1; | ||
179 | break; | ||
180 | |||
181 | default: | ||
182 | if (n < 8) { | ||
183 | gpr[n++] = *pStackLongs; | ||
184 | p++; | ||
185 | } else { | ||
186 | *p++ = *pStackLongs; | ||
187 | } | ||
188 | pStackLongs += 1; | ||
189 | break; | ||
190 | } | ||
191 | pPT++; | ||
192 | } | ||
193 | |||
194 | |||
195 | /* figure out the address of the function we need to invoke */ | ||
196 | off = nVtableIndex; | ||
197 | off = off * 4; // 4 bytes per slot | ||
198 | mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable | ||
199 | mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset | ||
200 | mfunc = *((unsigned long **)mfunc); // the function is stored at the address | ||
201 | typedef void (*FunctionCall)(sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32); | ||
202 | FunctionCall ptr = (FunctionCall)mfunc; | ||
203 | |||
204 | /* Set up the machine registers and invoke the function */ | ||
205 | |||
206 | __asm__ __volatile__ ( | ||
207 | "lwz r3, 0(%0)\n\t" | ||
208 | "lwz r4, 4(%0)\n\t" | ||
209 | "lwz r5, 8(%0)\n\t" | ||
210 | "lwz r6, 12(%0)\n\t" | ||
211 | "lwz r7, 16(%0)\n\t" | ||
212 | "lwz r8, 20(%0)\n\t" | ||
213 | "lwz r9, 24(%0)\n\t" | ||
214 | "lwz r10, 28(%0)\n\t" | ||
215 | "lfd f1, 0(%1)\n\t" | ||
216 | "lfd f2, 8(%1)\n\t" | ||
217 | "lfd f3, 16(%1)\n\t" | ||
218 | "lfd f4, 24(%1)\n\t" | ||
219 | "lfd f5, 32(%1)\n\t" | ||
220 | "lfd f6, 40(%1)\n\t" | ||
221 | "lfd f7, 48(%1)\n\t" | ||
222 | "lfd f8, 56(%1)\n\t" | ||
223 | "lfd f9, 64(%1)\n\t" | ||
224 | "lfd f10, 72(%1)\n\t" | ||
225 | "lfd f11, 80(%1)\n\t" | ||
226 | "lfd f12, 88(%1)\n\t" | ||
227 | "lfd f13, 96(%1)\n\t" | ||
228 | : : "r" (gpr), "r" (fpr) | ||
229 | : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", | ||
230 | "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", | ||
231 | "f10", "f11", "f12", "f13" | ||
232 | ); | ||
233 | |||
234 | // tell gcc that r3 to r10 are not available to it for doing the TOC and exception munge on the func call | ||
235 | register sal_uInt32 r3 __asm__("r3"); | ||
236 | register sal_uInt32 r4 __asm__("r4"); | ||
237 | register sal_uInt32 r5 __asm__("r5"); | ||
238 | register sal_uInt32 r6 __asm__("r6"); | ||
239 | register sal_uInt32 r7 __asm__("r7"); | ||
240 | register sal_uInt32 r8 __asm__("r8"); | ||
241 | register sal_uInt32 r9 __asm__("r9"); | ||
242 | register sal_uInt32 r10 __asm__("r10"); | ||
243 | |||
244 | (*ptr)(r3, r4, r5, r6, r7, r8, r9, r10); | ||
245 | |||
246 | |||
247 | __asm__ __volatile__ ( | ||
248 | "stw r3, %1\n\t" | ||
249 | "stw r4, %2\n\t" | ||
250 | "stfd f1, %0\n\t" | ||
251 | : : "m" (dret), "m" (iret), "m" (iret2) | ||
252 | ); | ||
253 | |||
254 | |||
255 | switch( eReturnType ) | ||
256 | { | ||
257 | case typelib_TypeClass_HYPER: | ||
258 | case typelib_TypeClass_UNSIGNED_HYPER: | ||
259 | ((long*)pRegisterReturn)[1] = iret2; | ||
260 | // fall thru on purpose | ||
261 | case typelib_TypeClass_LONG: | ||
262 | case typelib_TypeClass_UNSIGNED_LONG: | ||
263 | case typelib_TypeClass_ENUM: | ||
264 | ((long*)pRegisterReturn)[0] = iret; | ||
265 | break; | ||
266 | |||
267 | case typelib_TypeClass_CHAR: | ||
268 | case typelib_TypeClass_SHORT: | ||
269 | case typelib_TypeClass_UNSIGNED_SHORT: | ||
270 | *(unsigned short*)pRegisterReturn = (unsigned short)iret; | ||
271 | break; | ||
272 | |||
273 | case typelib_TypeClass_BOOLEAN: | ||
274 | case typelib_TypeClass_BYTE: | ||
275 | *(unsigned char*)pRegisterReturn = (unsigned char)iret; | ||
276 | break; | ||
277 | |||
278 | case typelib_TypeClass_FLOAT: | ||
279 | *(float*)pRegisterReturn = (float)dret; | ||
280 | break; | ||
281 | |||
282 | case typelib_TypeClass_DOUBLE: | ||
283 | *(double*)pRegisterReturn = dret; | ||
284 | break; | ||
285 | default: | ||
286 | break; | ||
287 | } | ||
288 | } | ||
289 | |||
290 | |||
291 | //================================================================================================== | ||
292 | static void cpp_call( | ||
293 | bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, | ||
294 | bridges::cpp_uno::shared::VtableSlot aVtableSlot, | ||
295 | typelib_TypeDescriptionReference * pReturnTypeRef, | ||
296 | sal_Int32 nParams, typelib_MethodParameter * pParams, | ||
297 | void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) | ||
298 | { | ||
299 | // max space for: [complex ret ptr], values|ptr ... | ||
300 | char * pCppStack = | ||
301 | (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); | ||
302 | char * pCppStackStart = pCppStack; | ||
303 | |||
304 | // need to know parameter types for callVirtualMethod so generate a signature string | ||
305 | char * pParamType = (char *) alloca(nParams+2); | ||
306 | char * pPT = pParamType; | ||
307 | |||
308 | // return | ||
309 | typelib_TypeDescription * pReturnTypeDescr = 0; | ||
310 | TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); | ||
311 | OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); | ||
312 | |||
313 | void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion | ||
314 | |||
315 | if (pReturnTypeDescr) | ||
316 | { | ||
317 | if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) | ||
318 | { | ||
319 | pCppReturn = pUnoReturn; // direct way for simple types | ||
320 | } | ||
321 | else | ||
322 | { | ||
323 | // complex return via ptr | ||
324 | pCppReturn = *(void **)pCppStack | ||
325 | = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) | ||
326 | ? alloca( pReturnTypeDescr->nSize ) | ||
327 | : pUnoReturn); // direct way | ||
328 | *pPT++ = 'C'; //signify that a complex return type on stack | ||
329 | pCppStack += sizeof(void *); | ||
330 | } | ||
331 | } | ||
332 | // push this | ||
333 | void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI()) | ||
334 | + aVtableSlot.offset; | ||
335 | *(void**)pCppStack = pAdjustedThisPtr; | ||
336 | pCppStack += sizeof( void* ); | ||
337 | *pPT++ = 'I'; | ||
338 | |||
339 | // stack space | ||
340 | OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" ); | ||
341 | // args | ||
342 | void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); | ||
343 | // indizes of values this have to be converted (interface conversion cpp<=>uno) | ||
344 | sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); | ||
345 | // type descriptions for reconversions | ||
346 | typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); | ||
347 | |||
348 | sal_Int32 nTempIndizes = 0; | ||
349 | |||
350 | for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) | ||
351 | { | ||
352 | const typelib_MethodParameter & rParam = pParams[nPos]; | ||
353 | typelib_TypeDescription * pParamTypeDescr = 0; | ||
354 | TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); | ||
355 | |||
356 | if (!rParam.bOut | ||
357 | && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) | ||
358 | { | ||
359 | uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, | ||
360 | pThis->getBridge()->getUno2Cpp() ); | ||
361 | |||
362 | switch (pParamTypeDescr->eTypeClass) | ||
363 | { | ||
364 | |||
365 | // we need to know type of each param so that we know whether to use | ||
366 | // gpr or fpr to pass in parameters: | ||
367 | // Key: I - int, long, pointer, etc means pass in gpr | ||
368 | // B - byte value passed in gpr | ||
369 | // S - short value passed in gpr | ||
370 | // F - float value pass in fpr | ||
371 | // D - double value pass in fpr | ||
372 | // H - long long int pass in proper pairs of gpr (3,4) (5,6), etc | ||
373 | // X - indicates end of parameter description string | ||
374 | |||
375 | case typelib_TypeClass_LONG: | ||
376 | case typelib_TypeClass_UNSIGNED_LONG: | ||
377 | case typelib_TypeClass_ENUM: | ||
378 | *pPT++ = 'I'; | ||
379 | break; | ||
380 | case typelib_TypeClass_SHORT: | ||
381 | case typelib_TypeClass_CHAR: | ||
382 | case typelib_TypeClass_UNSIGNED_SHORT: | ||
383 | *pPT++ = 'S'; | ||
384 | break; | ||
385 | case typelib_TypeClass_BOOLEAN: | ||
386 | case typelib_TypeClass_BYTE: | ||
387 | *pPT++ = 'B'; | ||
388 | break; | ||
389 | case typelib_TypeClass_FLOAT: | ||
390 | *pPT++ = 'F'; | ||
391 | break; | ||
392 | case typelib_TypeClass_DOUBLE: | ||
393 | *pPT++ = 'D'; | ||
394 | pCppStack += sizeof(sal_Int32); // extra long | ||
395 | break; | ||
396 | case typelib_TypeClass_HYPER: | ||
397 | case typelib_TypeClass_UNSIGNED_HYPER: | ||
398 | *pPT++ = 'H'; | ||
399 | pCppStack += sizeof(sal_Int32); // extra long | ||
400 | default: | ||
401 | break; | ||
402 | } | ||
403 | |||
404 | // no longer needed | ||
405 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
406 | } | ||
407 | else // ptr to complex value | ref | ||
408 | { | ||
409 | if (! rParam.bIn) // is pure out | ||
410 | { | ||
411 | // cpp out is constructed mem, uno out is not! | ||
412 | uno_constructData( | ||
413 | *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), | ||
414 | pParamTypeDescr ); | ||
415 | pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call | ||
416 | // will be released at reconversion | ||
417 | ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; | ||
418 | } | ||
419 | // is in/inout | ||
420 | else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) | ||
421 | { | ||
422 | uno_copyAndConvertData( | ||
423 | *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), | ||
424 | pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); | ||
425 | |||
426 | pTempIndizes[nTempIndizes] = nPos; // has to be reconverted | ||
427 | // will be released at reconversion | ||
428 | ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; | ||
429 | } | ||
430 | else // direct way | ||
431 | { | ||
432 | *(void **)pCppStack = pCppArgs[nPos] = pUnoArgs[nPos]; | ||
433 | // no longer needed | ||
434 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
435 | } | ||
436 | *pPT++='I'; | ||
437 | } | ||
438 | pCppStack += sizeof(sal_Int32); // standard parameter length | ||
439 | } | ||
440 | |||
441 | // terminate the signature string | ||
442 | *pPT++='X'; | ||
443 | *pPT=0; | ||
444 | |||
445 | try | ||
446 | { | ||
447 | OSL_ENSURE( !( (pCppStack - pCppStackStart ) & 3), "UNALIGNED STACK !!! (Please DO panic)" ); | ||
448 | callVirtualMethod( | ||
449 | pAdjustedThisPtr, aVtableSlot.index, | ||
450 | pCppReturn, pReturnTypeDescr->eTypeClass, pParamType, | ||
451 | (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); | ||
452 | // NO exception occurred... | ||
453 | *ppUnoExc = 0; | ||
454 | |||
455 | // reconvert temporary params | ||
456 | for ( ; nTempIndizes--; ) | ||
457 | { | ||
458 | sal_Int32 nIndex = pTempIndizes[nTempIndizes]; | ||
459 | typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; | ||
460 | |||
461 | if (pParams[nIndex].bIn) | ||
462 | { | ||
463 | if (pParams[nIndex].bOut) // inout | ||
464 | { | ||
465 | uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value | ||
466 | uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, | ||
467 | pThis->getBridge()->getCpp2Uno() ); | ||
468 | } | ||
469 | } | ||
470 | else // pure out | ||
471 | { | ||
472 | uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, | ||
473 | pThis->getBridge()->getCpp2Uno() ); | ||
474 | } | ||
475 | // destroy temp cpp param => cpp: every param was constructed | ||
476 | uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); | ||
477 | |||
478 | TYPELIB_DANGER_RELEASE( pParamTypeDescr ); | ||
479 | } | ||
480 | // return value | ||
481 | if (pCppReturn && pUnoReturn != pCppReturn) | ||
482 | { | ||
483 | uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr, | ||
484 | pThis->getBridge()->getCpp2Uno() ); | ||
485 | uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release ); | ||
486 | } | ||
487 | } | ||
488 | catch (...) | ||
489 | { | ||
490 | // fill uno exception | ||
491 | fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); | ||
492 | |||
493 | // temporary params | ||
494 | for ( ; nTempIndizes--; ) | ||
495 | { | ||
496 | sal_Int32 nIndex = pTempIndizes[nTempIndizes]; | ||
497 | // destroy temp cpp param => cpp: every param was constructed | ||
498 | uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); | ||
499 | TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); | ||
500 | } | ||
501 | // return type | ||
502 | if (pReturnTypeDescr) | ||
503 | TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); | ||
504 | } | ||
505 | } | ||
506 | |||
507 | } | ||
508 | |||
509 | namespace bridges { namespace cpp_uno { namespace shared { | ||
510 | |||
511 | void unoInterfaceProxyDispatch( | ||
512 | uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr, | ||
513 | void * pReturn, void * pArgs[], uno_Any ** ppException ) | ||
514 | { | ||
515 | // is my surrogate | ||
516 | bridges::cpp_uno::shared::UnoInterfaceProxy * pThis | ||
517 | = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * > (pUnoI); | ||
518 | // typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; | ||
519 | |||
520 | switch (pMemberDescr->eTypeClass) | ||
521 | { | ||
522 | case typelib_TypeClass_INTERFACE_ATTRIBUTE: | ||
523 | { | ||
524 | |||
525 | VtableSlot aVtableSlot( | ||
526 | getVtableSlot( | ||
527 | reinterpret_cast< | ||
528 | typelib_InterfaceAttributeTypeDescription const * >( | ||
529 | pMemberDescr))); | ||
530 | |||
531 | if (pReturn) | ||
532 | { | ||
533 | // dependent dispatch | ||
534 | cpp_call( | ||
535 | pThis, aVtableSlot, | ||
536 | ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, | ||
537 | 0, 0, // no params | ||
538 | pReturn, pArgs, ppException ); | ||
539 | } | ||
540 | else | ||
541 | { | ||
542 | // is SET | ||
543 | typelib_MethodParameter aParam; | ||
544 | aParam.pTypeRef = | ||
545 | ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; | ||
546 | aParam.bIn = sal_True; | ||
547 | aParam.bOut = sal_False; | ||
548 | |||
549 | typelib_TypeDescriptionReference * pReturnTypeRef = 0; | ||
550 | OUString aVoidName("void"); | ||
551 | typelib_typedescriptionreference_new( | ||
552 | &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); | ||
553 | |||
554 | // dependent dispatch | ||
555 | aVtableSlot.index += 1; //get then set method | ||
556 | cpp_call( | ||
557 | pThis, aVtableSlot, | ||
558 | pReturnTypeRef, | ||
559 | 1, &aParam, | ||
560 | pReturn, pArgs, ppException ); | ||
561 | |||
562 | typelib_typedescriptionreference_release( pReturnTypeRef ); | ||
563 | } | ||
564 | |||
565 | break; | ||
566 | } | ||
567 | case typelib_TypeClass_INTERFACE_METHOD: | ||
568 | { | ||
569 | |||
570 | VtableSlot aVtableSlot( | ||
571 | getVtableSlot( | ||
572 | reinterpret_cast< | ||
573 | typelib_InterfaceMethodTypeDescription const * >( | ||
574 | pMemberDescr))); | ||
575 | switch (aVtableSlot.index) | ||
576 | { | ||
577 | // standard calls | ||
578 | case 1: // acquire uno interface | ||
579 | (*pUnoI->acquire)( pUnoI ); | ||
580 | *ppException = 0; | ||
581 | break; | ||
582 | case 2: // release uno interface | ||
583 | (*pUnoI->release)( pUnoI ); | ||
584 | *ppException = 0; | ||
585 | break; | ||
586 | case 0: // queryInterface() opt | ||
587 | { | ||
588 | typelib_TypeDescription * pTD = 0; | ||
589 | TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() ); | ||
590 | if (pTD) | ||
591 | { | ||
592 | uno_Interface * pInterface = 0; | ||
593 | (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( | ||
594 | pThis->pBridge->getUnoEnv(), | ||
595 | (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); | ||
596 | |||
597 | if (pInterface) | ||
598 | { | ||
599 | ::uno_any_construct( | ||
600 | reinterpret_cast< uno_Any * >( pReturn ), | ||
601 | &pInterface, pTD, 0 ); | ||
602 | (*pInterface->release)( pInterface ); | ||
603 | TYPELIB_DANGER_RELEASE( pTD ); | ||
604 | *ppException = 0; | ||
605 | break; | ||
606 | } | ||
607 | TYPELIB_DANGER_RELEASE( pTD ); | ||
608 | } | ||
609 | } // else perform queryInterface() | ||
610 | default: | ||
611 | // dependent dispatch | ||
612 | cpp_call( | ||
613 | pThis, aVtableSlot, | ||
614 | ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, | ||
615 | ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, | ||
616 | ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, | ||
617 | pReturn, pArgs, ppException ); | ||
618 | } | ||
619 | break; | ||
620 | } | ||
621 | default: | ||
622 | { | ||
623 | ::com::sun::star::uno::RuntimeException aExc( | ||
624 | OUString("illegal member type description!"), | ||
625 | ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); | ||
626 | |||
627 | Type const & rExcType = ::getCppuType( &aExc ); | ||
628 | // binary identical null reference | ||
629 | ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); | ||
630 | } | ||
631 | } | ||
632 | } | ||
633 | |||
634 | } } } | ||
635 | |||
636 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ | ||
diff --git a/configure.ac b/configure.ac index abd069d83c15..a3f50aa50285 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -2353,10 +2353,7 @@ dnl Check / find MacOSX SDK and compiler, version checks | |||
2353 | dnl =================================================================== | 2353 | dnl =================================================================== |
2354 | if test "$_os" = "Darwin"; then | 2354 | if test "$_os" = "Darwin"; then |
2355 | 2355 | ||
2356 | if test "$build_cpu" = i386 -a "$host_cpu" = powerpc; then | 2356 | if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then |
2357 | # Cross-compiling for PPC from Intel | ||
2358 | arch='-arch ppc' | ||
2359 | elif test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then | ||
2360 | bitness=-m32 | 2357 | bitness=-m32 |
2361 | else | 2358 | else |
2362 | bitness=-m64 | 2359 | bitness=-m64 |
@@ -3435,13 +3432,6 @@ darwin*) | |||
3435 | OUTPATH=unxiosr | 3432 | OUTPATH=unxiosr |
3436 | OS=IOS | 3433 | OS=IOS |
3437 | ;; | 3434 | ;; |
3438 | powerpc*) | ||
3439 | CPU=P | ||
3440 | CPUNAME=POWERPC | ||
3441 | RTL_ARCH=PowerPC | ||
3442 | PLATFORMID=macosx_powerpc | ||
3443 | OUTPATH=unxmacxp | ||
3444 | ;; | ||
3445 | i*86) | 3435 | i*86) |
3446 | if test "$BITNESS_OVERRIDE" = 64; then | 3436 | if test "$BITNESS_OVERRIDE" = 64; then |
3447 | AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS]) | 3437 | AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS]) |
@@ -5078,12 +5068,6 @@ if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then | |||
5078 | ], | 5068 | ], |
5079 | [ | 5069 | [ |
5080 | case "$_os-$host_cpu" in | 5070 | case "$_os-$host_cpu" in |
5081 | Darwin-powerpc) | ||
5082 | test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1 | ||
5083 | test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1 | ||
5084 | test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1 | ||
5085 | test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1 | ||
5086 | ;; | ||
5087 | Linux-i686) | 5071 | Linux-i686) |
5088 | test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2 | 5072 | test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2 |
5089 | test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4 | 5073 | test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4 |
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index 1c5b89f35c7c..d75733dbbfcc 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx | |||
@@ -56,7 +56,6 @@ | |||
56 | #define PLATFORM_NETBSD_X86 "netbsd_x86" | 56 | #define PLATFORM_NETBSD_X86 "netbsd_x86" |
57 | #define PLATFORM_NETBSD_X86_64 "netbsd_x86_64" | 57 | #define PLATFORM_NETBSD_X86_64 "netbsd_x86_64" |
58 | #define PLATFORM_MACOSX_X86 "macosx_x86" | 58 | #define PLATFORM_MACOSX_X86 "macosx_x86" |
59 | #define PLATFORM_MACOSX_PPC "macosx_powerpc" | ||
60 | #define PLATFORM_OPENBSD_X86 "openbsd_x86" | 59 | #define PLATFORM_OPENBSD_X86 "openbsd_x86" |
61 | #define PLATFORM_OPENBSD_X86_64 "openbsd_x86_64" | 60 | #define PLATFORM_OPENBSD_X86_64 "openbsd_x86_64" |
62 | #define PLATFORM_DRAGONFLY_X86 "dragonfly_x86" | 61 | #define PLATFORM_DRAGONFLY_X86 "dragonfly_x86" |
@@ -166,8 +165,6 @@ namespace | |||
166 | ret = checkOSandCPU("NetBSD", "X86_64"); | 165 | ret = checkOSandCPU("NetBSD", "X86_64"); |
167 | else if (token == PLATFORM_MACOSX_X86) | 166 | else if (token == PLATFORM_MACOSX_X86) |
168 | ret = checkOSandCPU("MacOSX", "x86"); | 167 | ret = checkOSandCPU("MacOSX", "x86"); |
169 | else if (token == PLATFORM_MACOSX_PPC) | ||
170 | ret = checkOSandCPU("MacOSX", "PowerPC"); | ||
171 | else if (token == PLATFORM_AIX_POWERPC) | 168 | else if (token == PLATFORM_AIX_POWERPC) |
172 | ret = checkOSandCPU("AIX", "PowerPC"); | 169 | ret = checkOSandCPU("AIX", "PowerPC"); |
173 | else if (token == PLATFORM_OPENBSD_X86) | 170 | else if (token == PLATFORM_OPENBSD_X86) |
diff --git a/helpcompiler/Library_helplinker.mk b/helpcompiler/Library_helplinker.mk index 26a5dbac4aab..9a6a989efaa8 100644 --- a/helpcompiler/Library_helplinker.mk +++ b/helpcompiler/Library_helplinker.mk | |||
@@ -68,15 +68,8 @@ $(eval $(call gb_Library_add_exception_objects,helplinker,\ | |||
68 | helpcompiler/source/BasCodeTagger \ | 68 | helpcompiler/source/BasCodeTagger \ |
69 | )) | 69 | )) |
70 | 70 | ||
71 | ifeq ($(strip $(OS)$(CPU)$(COM)),MACOSXPGCC) | ||
72 | $(eval $(call gb_Library_add_cxxobjects,helplinker,\ | ||
73 | helpcompiler/source/HelpLinker \ | ||
74 | , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \ | ||
75 | )) | ||
76 | else | ||
77 | $(eval $(call gb_Library_add_exception_objects,helplinker,\ | 71 | $(eval $(call gb_Library_add_exception_objects,helplinker,\ |
78 | helpcompiler/source/HelpLinker \ | 72 | helpcompiler/source/HelpLinker \ |
79 | )) | 73 | )) |
80 | endif | ||
81 | 74 | ||
82 | # vim: set noet sw=4 ts=4: | 75 | # vim: set noet sw=4 ts=4: |
diff --git a/jpeg/UnpackedTarball_jpeg.mk b/jpeg/UnpackedTarball_jpeg.mk index 19e4dd7930f8..d2bdfd69b147 100644 --- a/jpeg/UnpackedTarball_jpeg.mk +++ b/jpeg/UnpackedTarball_jpeg.mk | |||
@@ -17,10 +17,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,jpeg,\ | |||
17 | jpeg/patches/jpeg-8c-jmorecfg.patch \ | 17 | jpeg/patches/jpeg-8c-jmorecfg.patch \ |
18 | )) | 18 | )) |
19 | 19 | ||
20 | ifeq ($(OS)$(CPU),MACOSXP) | ||
21 | $(eval $(call gb_UnpackedTarball_add_patches,jpeg,\ | ||
22 | jpeg/patches/struct_alignment.patch \ | ||
23 | )) | ||
24 | endif | ||
25 | |||
26 | # vim: set noet sw=4 ts=4: | 20 | # vim: set noet sw=4 ts=4: |
diff --git a/jpeg/patches/struct_alignment.patch b/jpeg/patches/struct_alignment.patch deleted file mode 100644 index 09966c3392d2..000000000000 --- a/jpeg/patches/struct_alignment.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | without this patch, the jpeg_decompress_struct & jpec_compress_struct will be padded, this in turn | ||
2 | results in a mismatch when the jpeg filter in svtools is built, where no | ||
3 | padding is assumed. Only affects Mac/PPC apparenlty, see fdo#47035 | ||
4 | --- misc/jpeg-8c/jpeglib.h 2010-11-17 22:01:56.000000000 +0100 | ||
5 | +++ misc/build/jpeg-8c/jpeglib.h 2012-05-19 13:58:31.000000000 +0200 | ||
6 | @@ -288,9 +288,9 @@ | ||
7 | JDIMENSION image_width; /* input image width */ | ||
8 | JDIMENSION image_height; /* input image height */ | ||
9 | int input_components; /* # of color components in input image */ | ||
10 | - J_COLOR_SPACE in_color_space; /* colorspace of input image */ | ||
11 | |||
12 | double input_gamma; /* image gamma of input image */ | ||
13 | + J_COLOR_SPACE in_color_space; /* colorspace of input image */ | ||
14 | |||
15 | /* Compression parameters --- these fields must be set before calling | ||
16 | * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to | ||
17 | @@ -359,16 +359,16 @@ | ||
18 | /* Parameters controlling emission of special markers. */ | ||
19 | |||
20 | boolean write_JFIF_header; /* should a JFIF marker be written? */ | ||
21 | + boolean write_Adobe_marker; /* should an Adobe marker be written? */ | ||
22 | UINT8 JFIF_major_version; /* What to write for the JFIF version number */ | ||
23 | UINT8 JFIF_minor_version; | ||
24 | /* These three values are not used by the JPEG code, merely copied */ | ||
25 | /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ | ||
26 | /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ | ||
27 | /* ratio is defined by X_density/Y_density even when density_unit=0. */ | ||
28 | - UINT8 density_unit; /* JFIF code for pixel size units */ | ||
29 | UINT16 X_density; /* Horizontal pixel density */ | ||
30 | UINT16 Y_density; /* Vertical pixel density */ | ||
31 | - boolean write_Adobe_marker; /* should an Adobe marker be written? */ | ||
32 | + UINT8 density_unit; /* JFIF code for pixel size units */ | ||
33 | |||
34 | /* State variable: index of next scanline to be written to | ||
35 | * jpeg_write_scanlines(). Application may use this to control its | ||
36 | @@ -583,11 +583,11 @@ | ||
37 | /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ | ||
38 | UINT8 JFIF_major_version; /* JFIF version number */ | ||
39 | UINT8 JFIF_minor_version; | ||
40 | + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ | ||
41 | UINT8 density_unit; /* JFIF code for pixel size units */ | ||
42 | UINT16 X_density; /* Horizontal pixel density */ | ||
43 | UINT16 Y_density; /* Vertical pixel density */ | ||
44 | boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ | ||
45 | - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ | ||
46 | |||
47 | boolean CCIR601_sampling; /* TRUE=first samples are cosited */ | ||
48 | |||
diff --git a/libxmlsec/UnpackedTarball_xmlsec.mk b/libxmlsec/UnpackedTarball_xmlsec.mk index fc2ed16a5336..7860295c4e68 100644 --- a/libxmlsec/UnpackedTarball_xmlsec.mk +++ b/libxmlsec/UnpackedTarball_xmlsec.mk | |||
@@ -42,10 +42,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,xmlsec,\ | |||
42 | )) | 42 | )) |
43 | endif | 43 | endif |
44 | 44 | ||
45 | ifeq ($(OS)$(CPU),MACOSXP) | ||
46 | $(eval $(call gb_UnpackedTarball_add_patches,xmlsec,\ | ||
47 | libxmlsec/xmlsec1-1.2.14_old_automake.patch \ | ||
48 | )) | ||
49 | endif | ||
50 | |||
51 | # vim: set noet sw=4 ts=4: | 45 | # vim: set noet sw=4 ts=4: |
diff --git a/libxmlsec/xmlsec1-1.2.14_old_automake.patch b/libxmlsec/xmlsec1-1.2.14_old_automake.patch deleted file mode 100644 index a80265903b07..000000000000 --- a/libxmlsec/xmlsec1-1.2.14_old_automake.patch +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | --- misc/xmlsec1-1.2.14/configure.in 2012-09-12 19:15:56.000000000 +0200 | ||
2 | +++ misc/build/xmlsec1-1.2.14/configure.in 2012-09-12 18:56:01.000000000 +0200 | ||
3 | @@ -21,8 +21,8 @@ | ||
4 | AC_SUBST(XMLSEC_VERSION_INFO) | ||
5 | |||
6 | AC_CONFIG_MACRO_DIR(m4) | ||
7 | -AM_INIT_AUTOMAKE([1.7 tar-ustar]) | ||
8 | -AC_CONFIG_HEADERS([config.h]) | ||
9 | +AM_INIT_AUTOMAKE([1.6.3]) | ||
10 | +AM_CONFIG_HEADER([config.h]) | ||
11 | AM_MAINTAINER_MODE | ||
12 | |||
13 | dnl | ||
14 | --- misc/xmlsec1-1.2.14/src/gnutls/Makefile.am 2009-12-05 22:19:18.000000000 +0100 | ||
15 | +++ misc/build/xmlsec1-1.2.14/src/gnutls/Makefile.am 2012-09-12 19:09:38.000000000 +0200 | ||
16 | @@ -18,7 +18,11 @@ | ||
17 | $(LIBXML_CFLAGS) \ | ||
18 | $(NULL) | ||
19 | |||
20 | -libxmlsec1_gnutls_la_SOURCES =\ | ||
21 | +if SHAREDLIB_HACK | ||
22 | +SHAREDLIBHACKDEP = ../strings.c | ||
23 | +endif | ||
24 | + | ||
25 | +libxmlsec1_gnutls_la_SOURCES = $(SHAREDLIBHACKDEP) \ | ||
26 | app.c \ | ||
27 | ciphers.c \ | ||
28 | crypto.c \ | ||
29 | @@ -28,10 +32,6 @@ | ||
30 | globals.h \ | ||
31 | $(NULL) | ||
32 | |||
33 | -if SHAREDLIB_HACK | ||
34 | -libxmlsec1_gnutls_la_SOURCES += ../strings.c | ||
35 | -endif | ||
36 | - | ||
37 | libxmlsec1_gnutls_la_LIBADD = \ | ||
38 | ../libxmlsec1.la \ | ||
39 | $(GNUTLS_LIBS) \ | ||
40 | --- misc/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2012-09-12 19:15:56.000000000 +0200 | ||
41 | +++ misc/build/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2012-09-12 19:10:52.000000000 +0200 | ||
42 | @@ -19,7 +19,11 @@ | ||
43 | $(LIBXML_CFLAGS) \ | ||
44 | $(NULL) | ||
45 | |||
46 | -libxmlsec1_mscrypto_la_SOURCES =\ | ||
47 | +if SHAREDLIB_HACK | ||
48 | +SHAREDLIBHACKDEP = ../strings.c | ||
49 | +endif | ||
50 | + | ||
51 | +libxmlsec1_mscrypto_la_SOURCES = $(SHAREDLIBHACKDEP) \ | ||
52 | app.c \ | ||
53 | certkeys.c \ | ||
54 | ciphers.c \ | ||
55 | @@ -38,10 +42,6 @@ | ||
56 | akmngr.c \ | ||
57 | $(NULL) | ||
58 | |||
59 | -if SHAREDLIB_HACK | ||
60 | -libxmlsec1_mscrypto_la_SOURCES += ../strings.c | ||
61 | -endif | ||
62 | - | ||
63 | libxmlsec1_mscrypto_la_LIBADD = \ | ||
64 | ../libxmlsec1.la \ | ||
65 | $(MSCRYPTO_LIBS) \ | ||
66 | --- misc/xmlsec1-1.2.14/src/nss/Makefile.am 2012-09-12 19:15:56.000000000 +0200 | ||
67 | +++ misc/build/xmlsec1-1.2.14/src/nss/Makefile.am 2012-09-12 19:11:58.000000000 +0200 | ||
68 | @@ -8,7 +8,7 @@ | ||
69 | libxmlsec1-nss.la \ | ||
70 | $(NULL) | ||
71 | |||
72 | -libxmlsec1_nss_la_CPPFLAGS = \ | ||
73 | +libxmlsec1_nss_la_CFLAGS = \ | ||
74 | -DPACKAGE=\"@PACKAGE@\" \ | ||
75 | -I../../include \ | ||
76 | -I$(top_srcdir)/include \ | ||
77 | @@ -18,7 +18,11 @@ | ||
78 | $(LIBXML_CFLAGS) \ | ||
79 | $(NULL) | ||
80 | |||
81 | -libxmlsec1_nss_la_SOURCES =\ | ||
82 | +if SHAREDLIB_HACK | ||
83 | +SHAREDLIBHACKDEP = ../strings.c | ||
84 | +endif | ||
85 | + | ||
86 | +libxmlsec1_nss_la_SOURCES = $(SHAREDLIBHACKDEP) \ | ||
87 | app.c \ | ||
88 | bignum.c \ | ||
89 | ciphers.c \ | ||
90 | @@ -40,10 +44,6 @@ | ||
91 | tokens.c \ | ||
92 | $(NULL) | ||
93 | |||
94 | -if SHAREDLIB_HACK | ||
95 | -libxmlsec1_nss_la_SOURCES += ../strings.c | ||
96 | -endif | ||
97 | - | ||
98 | libxmlsec1_nss_la_LIBADD = \ | ||
99 | ../libxmlsec1.la \ | ||
100 | $(NSS_LIBS) \ | ||
101 | --- misc/xmlsec1-1.2.14/src/openssl/Makefile.am 2009-12-05 22:19:18.000000000 +0100 | ||
102 | +++ misc/build/xmlsec1-1.2.14/src/openssl/Makefile.am 2012-09-12 19:12:55.000000000 +0200 | ||
103 | @@ -18,7 +18,11 @@ | ||
104 | $(LIBXML_CFLAGS) \ | ||
105 | $(NULL) | ||
106 | |||
107 | -libxmlsec1_openssl_la_SOURCES =\ | ||
108 | +if SHAREDLIB_HACK | ||
109 | +SHAREDLIBHACKDEP = ../strings.c | ||
110 | +endif | ||
111 | + | ||
112 | +libxmlsec1_openssl_la_SOURCES = $(SHAREDLIBHACKDEP) \ | ||
113 | app.c \ | ||
114 | bn.c \ | ||
115 | ciphers.c \ | ||
116 | @@ -36,10 +40,6 @@ | ||
117 | globals.h \ | ||
118 | $(NULL) | ||
119 | |||
120 | -if SHAREDLIB_HACK | ||
121 | -libxmlsec1_openssl_la_SOURCES += ../strings.c | ||
122 | -endif | ||
123 | - | ||
124 | libxmlsec1_openssl_la_LIBADD = \ | ||
125 | ../libxmlsec1.la \ | ||
126 | $(OPENSSL_LIBS) \ | ||
diff --git a/nss/ExternalProject_nss.mk b/nss/ExternalProject_nss.mk index e37b6ba0f852..46ced7c4aebc 100644 --- a/nss/ExternalProject_nss.mk +++ b/nss/ExternalProject_nss.mk | |||
@@ -75,7 +75,6 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject | |||
75 | $(if $(filter 1060 1070 1080,$(MAC_OS_X_VERSION_MIN_REQUIRED)),NSS_USE_SYSTEM_SQLITE=1)) \ | 75 | $(if $(filter 1060 1070 1080,$(MAC_OS_X_VERSION_MIN_REQUIRED)),NSS_USE_SYSTEM_SQLITE=1)) \ |
76 | $(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \ | 76 | $(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \ |
77 | $(if $(filter YES,$(CROSS_COMPILING)),\ | 77 | $(if $(filter YES,$(CROSS_COMPILING)),\ |
78 | $(if $(filter MACOSXP,$(OS)$(CPU)),CPU_ARCH=ppc) \ | ||
79 | NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/nss/nsinstall.py") \ | 78 | NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/nss/nsinstall.py") \ |
80 | NSDISTMODE=copy \ | 79 | NSDISTMODE=copy \ |
81 | $(MAKE) -j1 nss_build_all \ | 80 | $(MAKE) -j1 nss_build_all \ |
diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk index 58abdd561601..2a24e8b7fc70 100644 --- a/odk/settings/settings.mk +++ b/odk/settings/settings.mk | |||
@@ -390,9 +390,6 @@ else | |||
390 | ifeq "$(PROCTYPE)" "x86_64" | 390 | ifeq "$(PROCTYPE)" "x86_64" |
391 | UNOPKG_PLATFORM=MacOSX_x86 | 391 | UNOPKG_PLATFORM=MacOSX_x86 |
392 | JAVA_PROC_TYPE=x86 | 392 | JAVA_PROC_TYPE=x86 |
393 | else | ||
394 | UNOPKG_PLATFORM=MacOSX_PowerPC | ||
395 | JAVA_PROC_TYPE=ppc | ||
396 | endif | 393 | endif |
397 | endif | 394 | endif |
398 | JAVABIN=Commands | 395 | JAVABIN=Commands |
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm index 18d2768eada4..96ecf6152b79 100644 --- a/solenv/bin/modules/installer/download.pm +++ b/solenv/bin/modules/installer/download.pm | |||
@@ -424,10 +424,6 @@ sub get_download_architecture | |||
424 | { | 424 | { |
425 | $arch = "x86-64"; | 425 | $arch = "x86-64"; |
426 | } | 426 | } |
427 | elsif ( $installer::globals::compiler =~ /^unxmacxp/ ) | ||
428 | { | ||
429 | $arch = "PPC"; | ||
430 | } | ||
431 | 427 | ||
432 | return $arch; | 428 | return $arch; |
433 | } | 429 | } |
@@ -599,7 +595,6 @@ sub resolve_variables_in_downloadname | |||
599 | elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; } | 595 | elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; } |
600 | elsif ( $installer::globals::compiler =~ /unxmacxi/ ) { $os = "macosxi"; } | 596 | elsif ( $installer::globals::compiler =~ /unxmacxi/ ) { $os = "macosxi"; } |
601 | elsif ( $installer::globals::compiler =~ /unxmacxx/ ) { $os = "macosxx"; } | 597 | elsif ( $installer::globals::compiler =~ /unxmacxx/ ) { $os = "macosxx"; } |
602 | elsif ( $installer::globals::compiler =~ /unxmacxp/ ) { $os = "macosxp"; } | ||
603 | else { $os = ""; } | 598 | else { $os = ""; } |
604 | $downloadname =~ s/\{os\}/$os/; | 599 | $downloadname =~ s/\{os\}/$os/; |
605 | 600 | ||
diff --git a/testtools/Module_testtools.mk b/testtools/Module_testtools.mk index fe812de2c398..fe55ea8c5907 100644 --- a/testtools/Module_testtools.mk +++ b/testtools/Module_testtools.mk | |||
@@ -51,13 +51,9 @@ $(eval $(call gb_Module_add_targets,testtools,\ | |||
51 | )) | 51 | )) |
52 | endif | 52 | endif |
53 | 53 | ||
54 | # FIXME: Mac OSX PPC GCC fails this test!, likely broken UNO bridge. | ||
55 | # (is it still relevant?) | ||
56 | ifneq ($(COM)$(OS)$(CPU),GCCMACOSXP) | ||
57 | $(eval $(call gb_Module_add_check_targets,testtools,\ | 54 | $(eval $(call gb_Module_add_check_targets,testtools,\ |
58 | CustomTarget_uno_test \ | 55 | CustomTarget_uno_test \ |
59 | )) | 56 | )) |
60 | endif | ||
61 | 57 | ||
62 | endif | 58 | endif |
63 | 59 | ||
diff --git a/xpdf/ExternalProject_xpdf.mk b/xpdf/ExternalProject_xpdf.mk index 181128c2e2db..4a96c9e920d6 100644 --- a/xpdf/ExternalProject_xpdf.mk +++ b/xpdf/ExternalProject_xpdf.mk | |||
@@ -38,7 +38,6 @@ $(call gb_ExternalProject_get_state_target,xpdf,build): | |||
38 | $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ | 38 | $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ |
39 | $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ | 39 | $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ |
40 | $(if $(SYSBASE),CFLAGS="-I$(SYSBASE)/usr/include") \ | 40 | $(if $(SYSBASE),CFLAGS="-I$(SYSBASE)/usr/include") \ |
41 | $(if $(filter MACOSXP,$(OS)$(CPU)),CXXFLAGS="-malign-natural") \ | ||
42 | && MAKEFLAGS="$(subst r,,$(MAKEFLAGS))" $(MAKE) \ | 41 | && MAKEFLAGS="$(subst r,,$(MAKEFLAGS))" $(MAKE) \ |
43 | ) | 42 | ) |
44 | 43 | ||