Changeset 5634


Ignore:
Timestamp:
Dec 22, 2006, 12:39:41 AM (18 years ago)
Author:
Gary Byers
Message:

Insist on at least Panther for PPC32/Darwin.

Use dlopen() on 64-bit Darwin variants. Might want to do a runtime
test and use dlfcn functions if at least Tiger.

(The old dyld functions are deprecated under Leopard, and there's
reason to believe that they don't work correctly on at least ppc64/
Leopard; attempting to use NSCreateObjectFileImageFromFile to open
a 64-bit .dylib seems to lead to memory corruption rather than
returning NSObjectFileImageInappropriateFile.

The old functions work better than the dlfcn functions on pre-Tiger
systems.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/pmcl-kernel.c

    r5612 r5634  
    11881188#ifdef DARWIN
    11891189#ifdef PPC64
    1190 #define min_os_version "8.0"
     1190#define min_os_version "8.0"    /* aka Tiger */
    11911191#else
    1192 #define min_os_version "6.0"
     1192#define min_os_version "7.0"    /* aka Panther */
    11931193#endif
    11941194#endif
     
    15971597xGetSharedLibrary(char *path, int *resultType)
    15981598{
     1599#if WORD_SIZE == 32
    15991600  NSObjectFileImageReturnCode code;
    16001601  NSObjectFileImage              moduleImage;
     
    16821683    }
    16831684  return result;
     1685#else
     1686  const char *                   error;
     1687  void *                         result;
     1688
     1689  result = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
     1690 
     1691  if (result == NULL) {
     1692    error = dlerror();
     1693    *resultType = 0;
     1694    return error;
     1695  }
     1696  *resultType = 1;
     1697  return result;
     1698#endif
    16841699}
    16851700#endif
Note: See TracChangeset for help on using the changeset viewer.