ObjFW  Diff

Differences From Artifact [91fefa5006]:

  • File src/OFApplication.m — part of check-in [c5e7dd679b] at 2013-09-17 16:12:37 on branch trunk — Work around Android bugs.

    Includes:
    * Check environ against NULL before using it, since Android sets it to
    NULL.
    * Cast st_size of struct stat to off_t. Android uses long long for
    st_size as its off_t is only 32 bit, but st_size should be off_t
    according to POSIX.
    * Android's strtod() does not accept 0x, as specified by C99. Thus,
    the test is disabled if __ANDROID__ is defined. (user: js, size: 9892) [annotate] [blame] [check-ins using]

To Artifact [c9284fd43c]:


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#endif
- (void)OF_run;
@end

static OFApplication *app = nil;

static void
atexit_handler(void)
{
	id <OFApplicationDelegate> delegate = [app delegate];

	if ([delegate respondsToSelector: @selector(applicationWillTerminate)])
		[delegate applicationWillTerminate];

	[delegate release];







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#endif
- (void)OF_run;
@end

static OFApplication *app = nil;

static void
atexitHandler(void)
{
	id <OFApplicationDelegate> delegate = [app delegate];

	if ([delegate respondsToSelector: @selector(applicationWillTerminate)])
		[delegate applicationWillTerminate];

	[delegate release];
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
		char **env = environ;
#else
		char *env;
#endif

		environment = [[OFMutableDictionary alloc] init];

		atexit(atexit_handler);
#if defined(_WIN32)
		env = GetEnvironmentStringsW();

		while (*env != 0) {
			OFString *tmp, *key, *value;
			size_t length, pos;








|







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
		char **env = environ;
#else
		char *env;
#endif

		environment = [[OFMutableDictionary alloc] init];

		atexit(atexitHandler);
#if defined(_WIN32)
		env = GetEnvironmentStringsW();

		while (*env != 0) {
			OFString *tmp, *key, *value;
			size_t length, pos;