pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dynamic_load.c,v 1.88 2005/11/12 20:21:13 nilsson Exp $ + || $Id: dynamic_load.c,v 1.89 2006/07/05 19:06:32 mast Exp $   */      #ifdef TESTING   #define NO_PIKE_INCLUDES   #define CREATE_MAIN   #define NO_PIKE_GUTS   #endif      #ifndef NO_PIKE_INCLUDES   # include "global.h"
pike.git/src/dynamic_load.c:43:   #define USE_DLD   #define HAVE_SOME_DLOPEN   #define EMULATE_DLOPEN   #else   #if defined(HAVE_SHL_LOAD) && defined(HAVE_DL_H)   #define USE_HPUX_DL   #define HAVE_SOME_DLOPEN   #define EMULATE_DLOPEN   #else    - #if 0 + #ifdef USE_DLL   #if defined(HAVE_LOADLIBRARY) && defined(HAVE_FREELIBRARY) && \    defined(HAVE_GETPROCADDRESS) && defined(HAVE_WINBASE_H)   #define USE_LOADLIBRARY   #define HAVE_SOME_DLOPEN   #define EMULATE_DLOPEN   #endif - #endif /* 0 */ + #endif      #ifdef HAVE_MACH_O_DYLD_H   /* MacOS X... */   #define USE_DYLD   #define HAVE_SOME_DLOPEN   #define EMULATE_DLOPEN   #else /* !HAVE_MACH_O_DYLD_H */ - #ifdef USE_MY_WIN32_DLOPEN + #if !defined (USE_DLL) && defined (USE_MY_WIN32_DLOPEN)   #include "pike_dlfcn.h"   #define HAVE_SOME_DLOPEN   #define HAVE_DLOPEN   #endif   #endif /* HAVE_MACH_O_DYLD_H */      #endif   #endif   #else   #define HAVE_SOME_DLOPEN
pike.git/src/dynamic_load.c:95: Inside #if defined(HAVE_SOME_DLOPEN)
   return ret;   }      static void *dlopen(const char *foo, int how)   {    TCHAR *tmp;    HINSTANCE ret;    tmp=convert_string(foo, strlen(foo));    ret=LoadLibrary(tmp);    free((char *)tmp); -  if(ret) -  { -  void ** psym=(void **)GetProcAddress(ret, "PikeSymbol"); -  if(psym) -  { -  extern void *PikeSymbol[]; -  *psym = PikeSymbol; -  } -  } +     return (void *)ret;   }      static char * dlerror(void)   {    static char buffer[200];    sprintf(buffer,"LoadLibrary failed with error: %d",GetLastError());    return buffer;   }