mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Merge in changes from NET-Community.
Add DLL support on Windows platforms. Numerous minor bug fixes related to Windows platforms. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2420 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
aa0e1c2375
commit
2b06ef4c58
48 changed files with 2409 additions and 697 deletions
|
@ -152,12 +152,15 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
while (env[i])
|
||||
{
|
||||
cp = strchr(env[i],'=');
|
||||
/* Temporary set *cp to \0 for copying purposes */
|
||||
*cp = '\0';
|
||||
[keys addObject: [NSString stringWithCString:env[i]]];
|
||||
[values addObject: [NSString stringWithCString:cp+1]];
|
||||
/* Return the original value of environ[i] */
|
||||
*cp = '=';
|
||||
if (cp != NULL)
|
||||
{
|
||||
/* Temporary set *cp to \0 for copying purposes */
|
||||
*cp = '\0';
|
||||
[keys addObject: [NSString stringWithCString:env[i]]];
|
||||
[values addObject: [NSString stringWithCString:cp+1]];
|
||||
/* Return the original value of environ[i] */
|
||||
*cp = '=';
|
||||
}
|
||||
i++;
|
||||
}
|
||||
_gnu_environment = [[NSDictionary alloc] initWithObjects:values
|
||||
|
@ -260,7 +263,21 @@ __attribute__ ((section ("__libc_subinit"))) = &(_gnu_process_noobjc_args);
|
|||
#else
|
||||
static void * __gnustep_base_subinit_args__
|
||||
__attribute__ ((section ("_libc_subinit"))) = &(_gnu_process_args);
|
||||
#endif
|
||||
#endif /* linux */
|
||||
|
||||
#else
|
||||
#ifdef __MINGW32__
|
||||
/* For Windows32API Library, we know the global variables */
|
||||
extern int __argc;
|
||||
extern char** __argv;
|
||||
extern char** _environ;
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self == [NSProcessInfo class])
|
||||
_gnu_process_args(__argc, __argv, _environ);
|
||||
}
|
||||
|
||||
#else
|
||||
#undef main
|
||||
int main(int argc, char *argv[], char *env[])
|
||||
|
@ -285,7 +302,8 @@ int main(int argc, char *argv[], char *env[])
|
|||
/* Call the user defined main function */
|
||||
return gnustep_base_user_main (argc, argv, env);
|
||||
}
|
||||
#endif
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* __ELF__ */
|
||||
|
||||
/*************************************************************************
|
||||
*** Getting an NSProcessInfo Object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue