Skip to content

Commit

Permalink
Fixed GenericMap for build on Mona.
Browse files Browse the repository at this point in the history
  • Loading branch information
higepon committed Jun 14, 2010
1 parent 861e6e8 commit 6d04ee7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/FFI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#ifdef _WIN32
#include <windows.h>
#elif defined(MONA)
#else
#include <dlfcn.h>
#endif
Expand Down Expand Up @@ -59,6 +60,8 @@ void* FFI::open(const char* name)
{
#ifdef _WIN32
return (void *)LoadLibraryA(name); // FIXME : handle MBCS path
#elif defined(MONA)
return 0;
#else
return dlopen(name, RTLD_LAZY | RTLD_GLOBAL);
#endif
Expand All @@ -68,6 +71,8 @@ void* FFI::lookup(void* handle, const char* symbol)
{
#ifdef _WIN32
return (void *)GetProcAddress((HMODULE)handle,symbol);
#elif defined(MONA)
return 0;
#else
return dlsym(handle, symbol);
#endif
Expand All @@ -77,6 +82,8 @@ int FFI::close(void* handle)
{
#ifdef _WIN32
return FreeLibrary((HMODULE)handle);
#elif defined(MONA)
return 0;
#else
return dlclose(handle);
#endif
Expand All @@ -86,6 +93,8 @@ const char* FFI::lastError()
{
#ifdef _WIN32
return "win32 error"; //FIXME : stub
#elif defined(MONA)
return 0;
#else
return dlerror();
#endif
Expand Down
9 changes: 8 additions & 1 deletion src/GenericMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#else
#ifdef _WIN32
#include <unordered_map>
#elif defined MONA
#include <map>
#else
#include <tr1/unordered_map>
#endif
Expand Down Expand Up @@ -68,7 +70,12 @@ struct generic_equal_to
}
};

#if HAVE_EXT_HASHES
#ifdef MONA
typedef std::map<scheme::Object,
generic_hash_func,
generic_equal_to,
gc_allocator<std::pair<scheme::Object, scheme::Object> > > GenericMap;
#elif defined(HAVE_EXT_HASHES)
typedef __gnu_cxx::hash_map<scheme::Object,
scheme::Object,
generic_hash_func,
Expand Down

0 comments on commit 6d04ee7

Please sign in to comment.