NEURON
cygwinprt.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 #include <errno.h>
3 #include <unistd.h>
4 #if defined(CYGWIN) || defined(MINGW)
5 
6 #if !defined(__MINGW32__)
7 #include "system.cpp"
8 #define my_off64_t loff_t
9 #else
10 #define my_off64_t off64_t
11 #endif
12 
13 #include "mswinprt.cpp"
14 
15 my_off64_t lseek64(int fd, my_off64_t offset, int whence) {
16  fprintf(stderr, "called lseek64\n");
17  abort();
18 }
19 
20 /* mingw does not have dlfcn.h */
21 #if !defined(HAVE_DLFCN_H) || defined(__MINGW32__)
22 extern "C" {
23 void* dlopen(const char *name, int mode) {
24  void *ret;
25  /* handle for the named library */
26  ret = (void *) LoadLibrary(name);
27  if (ret == NULL) {
28  DWORD dw = GetLastError();
29  fprintf(stderr, "LoadLibrary(\"%s\") failed with error %d\n", name, dw);
30  }
31  return ret;
32 }
33 
34 void* dlopen_noerr(const char *name, int mode) {return (void*)LoadLibrary(name);}
35 
36 void* dlsym(void *handle, const char *name) {
37  void *ret = (void *) GetProcAddress ((HMODULE) handle, name);
38  if (!ret) {
39  fprintf(stderr, "Could not GetProcAddress for \"%s\"\n", name);
40  }
41  return ret;
42 }
43 
44 int dlclose(void* handle) {
45 }
46 
47 static char* dler_="";
48 char* dlerror() {
49  return dler_;
50 }
51 }
52 #endif /* HAVE_DLFCN_H */
53 
54 #endif
55 
const char * dlerror(void)
Definition: osxdlfcn.cpp:174
int dlclose(void *handle)
Definition: osxdlfcn.cpp:178
#define ret
Definition: redef.h:123
fprintf(stderr, "Don't know the location of params at %p\, pp)
void * dlopen(const char *path, int mode)
Definition: osxdlfcn.cpp:85
char * name
Definition: init.cpp:16
void * dlsym(void *handle, const char *symbol)
Definition: osxdlfcn.cpp:193
return NULL
Definition: cabcode.cpp:461