From: Tim R. <ti...@ga...> - 2002-08-24 17:59:50
|
On Sat, 24 Aug 2002 05:15:58 -0400 Patrick Mahoney <bo...@in...> wrote: | Tim: did you port the cli to windows? | I just read that the pthread library has been ported to windows as an | open source project with the lgpl license... | http://sources.redhat.com/pthreads-win32/ | | Might be as simple as downloading the .dll/.h files, setting you vc++ | environment, and recompiling... No real need. I just added a #ifdef in the CLI to get it to use _beginthread on VC++ instead of pthreads. It doesn't seem to use libdl or curses, either. I've just started porting my testbed app to the new architecture. However, I've come up against a fundamental obstacle: Environment doesn't allow access to the names of modules' ports (this will be a problem for the GUI too, clearly). I think the solution would be to add, say, Module* Environment::get_module(int id), but I'll leave it until I'm sure that you (Pat) can still compile with the changes I've made to the codebase. The major points: -- Changed register_plugin to: extern "C" void register_plugin( void *param, void (*add_module) (void *, const char *, CREATOR_FUNC)) Using a function instead of std::map avoids big problems on Windows. I didn't get to the root cause, but I think it relates to the problem of using new and delete across DLL boundaries: the DLL (basic.rap) uses one heap, the EXE (cli.exe) uses another. When one tries to free the other's memory you get a crash. I think that std::map was trying to do something similar and it broke. In any case, calling the function avoids mixing C++ standard library implementations (what if you wrote plugins in Cygwin and the EXE in VC++? their template implementations are different). -- Got src/plugins to link to bin/basic.rap instead of lots of .so. This resulted in a huge saving of disk space (with gcc each .so was taking up 700KB on disk with symbols included). This also avoids the need for me to maintain one VC++ project per module (VC++ only allows one target per project). -- Changed .shared rule to .shared.o. This lets us use .d files for sources that will always compile to .shared.o (the include $(OBJS:.o=.d) doesn't know about .shared but it does know about .shared.o). -- Put POSIX-specific dlXXX functionality into environment_linux.cpp. The linux part of the string should be set to whatever $(PLATFORM) is set to in make.conf. -- Tim Robinson <ti...@ga...> |