Mercurial > projects > qtd
comparison generator/containergenerator.cpp @ 384:d2f48c4cb3e3
Same behavior of shared libs on linux and windows. Minor build script fixes.
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Fri, 16 Jul 2010 20:04:29 +0300 |
parents | a032df77b6ab |
children |
comparison
equal
deleted
inserted
replaced
383:bd7f485e3573 | 384:d2f48c4cb3e3 |
---|---|
227 const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(te); | 227 const ComplexTypeEntry *centry = static_cast<const ComplexTypeEntry *>(te); |
228 QString cls_name = centry->name(); | 228 QString cls_name = centry->name(); |
229 | 229 |
230 QString module = packageToQtModule(cls->package()); | 230 QString module = packageToQtModule(cls->package()); |
231 setFuncNames(cls_name); | 231 setFuncNames(cls_name); |
232 s << "QTD_EXPORT(" << module << ", " << all_name << ")" << endl | 232 s << "QTD_FUNC(" << module << ", " << all_name << ")" << endl |
233 << "QTD_EXPORT(" << module << ", " << ass_name << ")" << endl | 233 << "QTD_FUNC(" << module << ", " << ass_name << ")" << endl |
234 << "QTD_EXPORT(" << module << ", " << get_name << ")" << endl << endl; | 234 << "QTD_FUNC(" << module << ", " << get_name << ")" << endl << endl; |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 /* | 238 /* |
239 QMap<const TypeEntry*, AbstractMetaType*> typeList = signalEntries[cls->package()]; | 239 QMap<const TypeEntry*, AbstractMetaType*> typeList = signalEntries[cls->package()]; |
240 | 240 |
241 QMapIterator<const TypeEntry*, AbstractMetaType*> i(typeList); | 241 QMapIterator<const TypeEntry*, AbstractMetaType*> i(typeList); |
242 while (i.hasNext()) { | 242 while (i.hasNext()) { |
243 i.next(); | 243 i.next(); |
244 s << "// " << i.key()->targetLangName() << endl | 244 s << "// " << i.key()->targetLangName() << endl |
245 << "QTD_EXTERN QTD_DLL_PUBLIC void qtd_" << package << "_" << i.key()->targetLangName() << "_to_d_array(void *cpp_ptr, DArray* __d_container) {" << endl; | 245 << "QTD_EXTERN QTD_EXPORT void qtd_" << package << "_" << i.key()->targetLangName() << "_to_d_array(void *cpp_ptr, DArray* __d_container) {" << endl; |
246 | 246 |
247 AbstractMetaType *arg_type = i.value(); | 247 AbstractMetaType *arg_type = i.value(); |
248 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption); | 248 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption); |
249 s << "container = (*reinterpret_cast< "; | 249 s << "container = (*reinterpret_cast< "; |
250 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference); | 250 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference); |
257 s << "// signal conversion functions" << endl; | 257 s << "// signal conversion functions" << endl; |
258 | 258 |
259 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) { | 259 foreach(AbstractMetaType* arg_type, signalEntries[cls->package()]) { |
260 const TypeEntry *te = arg_type->instantiations().first()->typeEntry(); | 260 const TypeEntry *te = arg_type->instantiations().first()->typeEntry(); |
261 s << "// " << te->targetLangName() << endl | 261 s << "// " << te->targetLangName() << endl |
262 << "QTD_EXTERN QTD_DLL_PUBLIC void " << cppContainerConversionName(cls, arg_type, FromCpp) << "(void *cpp_ptr, DArray* __d_container) {" << endl; | 262 << "QTD_EXTERN QTD_EXPORT void " << cppContainerConversionName(cls, arg_type, FromCpp) << "(void *cpp_ptr, DArray* __d_container) {" << endl; |
263 | 263 |
264 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption); | 264 m_cpp_impl_generator->writeTypeInfo(s, arg_type, NoOption); |
265 s << "container = (*reinterpret_cast< "; | 265 s << "container = (*reinterpret_cast< "; |
266 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference); | 266 m_cpp_impl_generator->writeTypeInfo(s, arg_type, ExcludeReference); |
267 s << "(*)>(cpp_ptr));" << endl; | 267 s << "(*)>(cpp_ptr));" << endl; |
316 | 316 |
317 setFuncNames(cls_name); | 317 setFuncNames(cls_name); |
318 | 318 |
319 QString module = packageToQtModule(centry->javaPackage()); | 319 QString module = packageToQtModule(centry->javaPackage()); |
320 | 320 |
321 s << "QTD_EXPORT_DECL(" << module << ", void, " << all_name << ", (void* arr, size_t len))" << endl | 321 s << "QTD_FUNC_DECL(" << module << ", void, " << all_name << ", (void* arr, size_t len))" << endl |
322 << "QTD_EXPORT_DECL(" << module << ", void, " << ass_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl | 322 << "QTD_FUNC_DECL(" << module << ", void, " << ass_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl |
323 << "QTD_EXPORT_DECL(" << module << ", void, " << get_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl; | 323 << "QTD_FUNC_DECL(" << module << ", void, " << get_name << ", (void* arr, size_t pos, " << cpp_type << " elem))" << endl; |
324 | 324 |
325 s << endl; | 325 s << endl; |
326 | 326 |
327 } | 327 } |
328 | 328 |