Branch: Tag:

2006-07-05

2006-07-05 19:06:32 by Martin Stjernholm <mast@lysator.liu.se>

Load using LoadLibrary for --enable-dll.

Rev: src/dynamic_load.c:1.89

2:   || 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
50:   #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... */
65:   #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
102: Inside #if defined(HAVE_SOME_DLOPEN)
   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;   }