ObjFW  Diff

Differences From Artifact [ee4e3a6986]:

To Artifact [a2974f4317]:


145
146
147
148
149
150
151
152
153



154
155

156
157
158
159
160
161
162
145
146
147
148
149
150
151


152
153
154
155

156
157
158
159
160
161
162
163







-
-
+
+
+

-
+







initOperatingSystemVersion(void)
{
#if defined(OF_IOS) || defined(OF_MACOS)
# ifdef OF_HAVE_FILES
	void *pool = objc_autoreleasePoolPush();

	@try {
		OFString *propertyList = [OFString stringWithContentsOfFile:
		    @"/System/Library/CoreServices/SystemVersion.plist"];
		OFDictionary *propertyList = [OFString stringWithContentsOfFile:
		    @"/System/Library/CoreServices/SystemVersion.plist"]
		    .propertyListValue;

		operatingSystemVersion = [[[propertyList propertyListValue]
		operatingSystemVersion = [[propertyList
		    objectForKey: @"ProductVersion"] copy];
	} @finally {
		objc_autoreleasePoolPop(pool);
	}
# endif
#elif defined(OF_WINDOWS)
# ifdef OF_HAVE_FILES
173
174
175
176
177
178
179
180
181


182
183
184
185
186
187
188
174
175
176
177
178
179
180


181
182
183
184
185
186
187
188
189







-
-
+
+







		systemDirLen = GetSystemDirectoryW(systemDir, PATH_MAX);
		if (systemDirLen == 0)
			return;

		systemDirString = [OFString
		    stringWithUTF16String: systemDir
				   length: systemDirLen];
		path = [[systemDirString stringByAppendingPathComponent:
		    @"kernel32.dll"] UTF16String];
		path = [systemDirString stringByAppendingPathComponent:
		    @"kernel32.dll"].UTF16String;

		if ((bufferLen = GetFileVersionInfoSizeW(path, NULL)) == 0)
			return;
		if ((buffer = malloc(bufferLen)) == 0)
			return;

		@try {
433
434
435
436
437
438
439
440

441
442
443
444
445
446
447
434
435
436
437
438
439
440

441
442
443
444
445
446
447
448







-
+







	return @"PROGDIR:";
# else
	OFDictionary *env = [OFApplication environment];
	OFString *var;
	void *pool;

	if ((var = [env objectForKey: @"XDG_DATA_HOME"]) != nil &&
	    [var length] > 0)
	    var.length > 0)
		return var;

	if ((var = [env objectForKey: @"HOME"]) == nil)
		@throw [OFNotImplementedException exceptionWithSelector: _cmd
								 object: self];

	pool = objc_autoreleasePoolPush();
526
527
528
529
530
531
532
533

534
535
536
537
538
539
540
527
528
529
530
531
532
533

534
535
536
537
538
539
540
541







-
+







# elif defined(OF_AMIGAOS)
	return @"PROGDIR:";
# else
	OFDictionary *env = [OFApplication environment];
	OFString *var;

	if ((var = [env objectForKey: @"XDG_CONFIG_HOME"]) != nil &&
	    [var length] > 0)
	    var.length > 0)
		return var;

	if ((var = [env objectForKey: @"HOME"]) == nil)
		@throw [OFNotImplementedException exceptionWithSelector: _cmd
								 object: self];

	return [var stringByAppendingPathComponent: @".config"];