1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <cstddef>
25 #include <rtl/string.hxx>
26 #include <typeinfo>
27 
28 typedef struct _uno_Any uno_Any;
29 typedef struct _uno_Mapping uno_Mapping;
30 
31 // private C50 structures and functions
32 namespace __Crun
33 {
34 	struct static_type_info
35 	{
36         std::ptrdiff_t m_pClassName;
37 		int			m_nSkip1; // must be 0
38 		void*		m_pMagic; // points to some magic data
39 		int			m_nMagic[ 4 ];
40 		int			m_nSkip2[2]; // must be 0
41 	};
42 	void* ex_alloc(unsigned);
43 	void ex_throw( void*, const static_type_info*, void(*)(void*));
44 	void* ex_get();
45 	void ex_rethrow_q() throw();
46 }
47 
48 namespace __Cimpl
49 {
50 	const char* ex_name();
51 }
52 
53 extern "C" void _ex_register( void*, int );
54 
55 namespace CPPU_CURRENT_NAMESPACE
56 {
57 
adjustPointer(char * pIn,typelib_TypeDescription * pType)58 inline char* adjustPointer( char* pIn, typelib_TypeDescription* pType )
59 {
60 	switch( pType->nSize )
61 	{
62 		case 1: return pIn + 3;
63 		case 2: return pIn + 2;
64 		case 3: return pIn + 1;
65 			// Huh ? perhaps a char[3] ? Though that would be a pointer
66 			// well, we have it anyway for symmetry
67 	}
68 	return pIn;
69 }
70 
71 //##################################################################################################
72 //#### exceptions ##################################################################################
73 //##################################################################################################
74 
75 void cc50_solaris_sparc_raiseException(
76     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
77 
78 void cc50_solaris_sparc_fillUnoException(
79     void*, const char*,
80     uno_Any*, uno_Mapping * pCpp2Uno );
81 
82 }
83 
84