]> AND Public Git Repository - simgrid.git/blobdiff - src/gras/Virtu/rl_process.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a indent rule to format the code in an uniform way, avoiding breaking the branche...
[simgrid.git] / src / gras / Virtu / rl_process.c
index 13b37571b3dc1d6f6551f037e67d3169a81f4dc7..ad664c0eb1e5c20938875d054a6b3625b8ca4102 100644 (file)
@@ -19,8 +19,14 @@ XBT_EXPORT_NO_IMPORT(char const *) _gras_procname = NULL;
 static xbt_dict_t _process_properties = NULL;
 static xbt_dict_t _host_properties = NULL;
 
-/* the environment, as specified by the opengroup, used to initialize the process properties */
-extern char **environ;          
+# ifdef __APPLE__
+/* under darwin, the environment gets added to the process at startup time. So, it's not defined at library link time, forcing us to extra tricks */
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+# else
+ /* the environment, as specified by the opengroup, used to initialize the process properties */
+ extern char **environ;
+# endif 
 
 void gras_process_init() {
   char **env_iter;