author | zautrix <zautrix> | 2004-07-08 00:16:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-08 00:16:46 (UTC) |
commit | e8628e6e3e98f2276fb69bbc545866cc9a022228 (patch) (unidiff) | |
tree | 798f61100c1ec3dab71a00ba63ac0d99fbd643b1 /microkde | |
parent | 5030b0bd32b1e526f28ce0339d4b4854492393ae (diff) | |
download | kdepimpi-e8628e6e3e98f2276fb69bbc545866cc9a022228.zip kdepimpi-e8628e6e3e98f2276fb69bbc545866cc9a022228.tar.gz kdepimpi-e8628e6e3e98f2276fb69bbc545866cc9a022228.tar.bz2 |
Compile fixes for windows
-rw-r--r-- | microkde/kdecore/klibloader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index 9eee912..1394154 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp | |||
@@ -333,111 +333,118 @@ void KLibLoader::cleanUp() | |||
333 | KLibLoader::KLibLoader( QObject* parent, const char* name ) | 333 | KLibLoader::KLibLoader( QObject* parent, const char* name ) |
334 | : QObject( parent, name ) | 334 | : QObject( parent, name ) |
335 | { | 335 | { |
336 | s_self = this; | 336 | s_self = this; |
337 | d = new KLibLoaderPrivate; | 337 | d = new KLibLoaderPrivate; |
338 | //US lt_dlinit(); | 338 | //US lt_dlinit(); |
339 | d->unload_mode = KLibLoaderPrivate::UNKNOWN; | 339 | d->unload_mode = KLibLoaderPrivate::UNKNOWN; |
340 | if (getenv("KDE_NOUNLOAD") != 0) | 340 | if (getenv("KDE_NOUNLOAD") != 0) |
341 | d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD; | 341 | d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD; |
342 | else if (getenv("KDE_DOUNLOAD") != 0) | 342 | else if (getenv("KDE_DOUNLOAD") != 0) |
343 | d->unload_mode = KLibLoaderPrivate::UNLOAD; | 343 | d->unload_mode = KLibLoaderPrivate::UNLOAD; |
344 | d->loaded_stack.setAutoDelete( true ); | 344 | d->loaded_stack.setAutoDelete( true ); |
345 | } | 345 | } |
346 | 346 | ||
347 | KLibLoader::~KLibLoader() | 347 | KLibLoader::~KLibLoader() |
348 | { | 348 | { |
349 | // kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; | 349 | // kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; |
350 | 350 | ||
351 | QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); | 351 | QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); |
352 | for (; it.current(); ++it ) | 352 | for (; it.current(); ++it ) |
353 | { | 353 | { |
354 | kdDebug(150) << "The KLibLoader contains the library " << it.current()->name | 354 | kdDebug(150) << "The KLibLoader contains the library " << it.current()->name |
355 | << " (" << it.current()->lib << ")" << endl; | 355 | << " (" << it.current()->lib << ")" << endl; |
356 | d->pending_close.append(it.current()); | 356 | d->pending_close.append(it.current()); |
357 | } | 357 | } |
358 | 358 | ||
359 | close_pending(0); | 359 | close_pending(0); |
360 | 360 | ||
361 | delete d; | 361 | delete d; |
362 | } | 362 | } |
363 | 363 | ||
364 | //static | 364 | //static |
365 | QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) | 365 | QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) |
366 | { | 366 | { |
367 | QCString libname( name ); | 367 | QCString libname( name ); |
368 | 368 | ||
369 | // only append ".la" if there is no extension | 369 | // only append ".la" if there is no extension |
370 | // this allows to load non-libtool libraries as well | 370 | // this allows to load non-libtool libraries as well |
371 | // (mhk, 20000228) | 371 | // (mhk, 20000228) |
372 | int pos = libname.findRev('/'); | 372 | int pos = libname.findRev('/'); |
373 | if (pos < 0) | 373 | if (pos < 0) |
374 | pos = 0; | 374 | pos = 0; |
375 | /*US | 375 | /*US |
376 | if (libname.find('.', pos) < 0) { | 376 | if (libname.find('.', pos) < 0) { |
377 | libname += ".la"; | 377 | libname += ".la"; |
378 | } | 378 | } |
379 | */ | 379 | */ |
380 | //US in the microedition we work only with shared libraries. | 380 | //US in the microedition we work only with shared libraries. |
381 | |||
381 | if (libname.find('.', pos) < 0) { | 382 | if (libname.find('.', pos) < 0) { |
383 | #ifdef _WIN32_ | ||
384 | libname += ".dll"; | ||
385 | #else | ||
382 | libname += ".so"; | 386 | libname += ".so"; |
387 | #endif | ||
383 | } | 388 | } |
384 | 389 | ||
385 | // only look up the file if it is not an absolute filename | 390 | // only look up the file if it is not an absolute filename |
386 | // (mhk, 20000228) | 391 | // (mhk, 20000228) |
387 | QString libfile; | 392 | QString libfile; |
388 | if (libname[0] == '/') | 393 | if (libname[0] == '/') |
389 | libfile = libname; | 394 | libfile = libname; |
390 | else | 395 | else |
391 | { | 396 | { |
392 | //US at this point the libname must exist as real filesname. No expansions will be made later | 397 | //US at this point the libname must exist as real filesname. No expansions will be made later |
393 | // in findResources. Because of that we prepend the lib prefix here to the name | 398 | // in findResources. Because of that we prepend the lib prefix here to the name |
394 | //US I add also the "lib" prefix. I do not how could this could have worked before without it? | 399 | //US I add also the "lib" prefix. I do not how could this could have worked before without it? |
400 | #ifndef _WIN32_ | ||
395 | libname.insert(pos, "lib"); | 401 | libname.insert(pos, "lib"); |
402 | #endif | ||
396 | 403 | ||
397 | 404 | ||
398 | //US libfile = instance->dirs()->findResource( "module", libname ); | 405 | //US libfile = instance->dirs()->findResource( "module", libname ); |
399 | //qDebug("libname = %s ",libname.data() ); | 406 | //qDebug("libname = %s ",libname.data() ); |
400 | libfile = KGlobal::dirs()->findResource( "module", libname ); | 407 | libfile = KGlobal::dirs()->findResource( "module", libname ); |
401 | //qDebug("libfile = %s ",libfile.latin1() ); | 408 | //qDebug("libfile = %s ",libfile.latin1() ); |
402 | 409 | ||
403 | if ( libfile.isEmpty() ) | 410 | if ( libfile.isEmpty() ) |
404 | { | 411 | { |
405 | //US libfile = instance->dirs()->findResource( "lib", libname ); | 412 | //US libfile = instance->dirs()->findResource( "lib", libname ); |
406 | libfile = KGlobal::dirs()->findResource( "lib", libname ); | 413 | libfile = KGlobal::dirs()->findResource( "lib", libname ); |
407 | //qDebug("libfile2 = %s ",libfile.latin1() ); | 414 | //qDebug("libfile2 = %s ",libfile.latin1() ); |
408 | #ifndef NDEBUG | 415 | #ifndef NDEBUG |
409 | if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules | 416 | if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules |
410 | kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; | 417 | kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; |
411 | #endif | 418 | #endif |
412 | } | 419 | } |
413 | if ( libfile.isEmpty() ) | 420 | if ( libfile.isEmpty() ) |
414 | { | 421 | { |
415 | #ifndef NDEBUG | 422 | #ifndef NDEBUG |
416 | kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; | 423 | kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; |
417 | self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); | 424 | self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); |
418 | 425 | ||
419 | qDebug("KLibLoader::library could not find library: %s", libname.data()); | 426 | qDebug("KLibLoader::library could not find library: %s", libname.data()); |
420 | #endif | 427 | #endif |
421 | 428 | ||
422 | } | 429 | } |
423 | else | 430 | else |
424 | self()->d->errorMessage = QString::null; | 431 | self()->d->errorMessage = QString::null; |
425 | } | 432 | } |
426 | 433 | ||
427 | //qDebug("return libfile = %s ",libfile.latin1() ); | 434 | //qDebug("return libfile = %s ",libfile.latin1() ); |
428 | return libfile; | 435 | return libfile; |
429 | } | 436 | } |
430 | 437 | ||
431 | 438 | ||
432 | KLibrary* KLibLoader::globalLibrary( const char *name ) | 439 | KLibrary* KLibLoader::globalLibrary( const char *name ) |
433 | { | 440 | { |
434 | KLibrary *tmp; | 441 | KLibrary *tmp; |
435 | /*US | 442 | /*US |
436 | int olt_dlopen_flag = lt_dlopen_flag; | 443 | int olt_dlopen_flag = lt_dlopen_flag; |
437 | 444 | ||
438 | lt_dlopen_flag |= LT_GLOBAL; | 445 | lt_dlopen_flag |= LT_GLOBAL; |
439 | kdDebug(150) << "Loading the next library global with flag " | 446 | kdDebug(150) << "Loading the next library global with flag " |
440 | << lt_dlopen_flag | 447 | << lt_dlopen_flag |
441 | << "." << endl; | 448 | << "." << endl; |
442 | */ | 449 | */ |
443 | tmp = library(name); | 450 | tmp = library(name); |