Index: cli.h
===================================================================
--- cli.h	(revision 366)
+++ cli.h	(revision 367)
@@ -11,7 +11,7 @@
 interface of Raydium.
 **/
 
-__rayapi int raydium_init_cli_option (char *option, char *value);
+__rayapi int raydium_init_cli_option(char *option, char *value);
 /**
 This function will search command line ##option##.
 If this option is found, the functions stores any argument to ##value## and
@@ -28,7 +28,7 @@
 %%
 **/
 
-__rayapi int raydium_init_cli_option_default (char *option, char *value, char *default_value);
+__rayapi int raydium_init_cli_option_default(char *option, char *value, char *default_value);
 /**
 Same as above, but allows you to provide a default value (##default##) if
 the ##option## is not found on command line.
@@ -39,7 +39,8 @@
 Internal use.
 **/
 
-__rayapi void raydium_init_args (int argc, char **argv);
+#ifndef RAYDLL
+__rayapi void raydium_init_args(int argc, char **argv);
 /**
 You must use this function, wich send application arguments to Raydium 
 and external libs (GLUT, OpenAL, ...).
@@ -52,12 +53,32 @@
 [...]
 %%
 **/
+#endif
 
+#ifndef RAYDLL
 __rayapi void raydium_init_args_name(int argc, char **argv, char *app_name);
 /**
 Same as above, but with application short name. This string is used to
 build things like runtime configuration directory name (~/.raydium/ by default).
 Use this wrapper if you don't want to share your configuration with Raydium.
 **/
+#endif
 
+
+/*
+Ok ... all this is a very ugly part: under win32, a DLL use a different
+atexit() queue than the application. We can't use the DLL_PROCESS_DETACH
+DLL reason, since it seems that OpenAL DLL is unloaded *before* raydium.dll !
+
+So the idea here is to provide a wrapper to the application for these two
+init functions so they use their own atexit() queue, in a transparent way.
+
+See atexit.h header for wrappers.
+*/
+#ifdef RAYDLL
+__rayapi void raydium_init_args_hack(int argc, char **argv);
+__rayapi void raydium_init_args_name_hack(int argc, char **argv, char *app_name);
 #endif
+
+
+#endif