ObjFW  Diff

Differences From Artifact [732a34cd87]:

To Artifact [6bda5c55f7]:


169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
		return MODE_READWRITE;
	}

	return -1;
}
#endif

#ifdef OF_NINTENDO_SWITCH
static bool initialized = false;

OF_DESTRUCTOR()
{
	if (initialized)
		romfsExit();
}
#endif

@implementation OFFile
+ (void)initialize
{
	if (self != [OFFile class])
		return;

#ifdef OF_WII







<
<
<
<
<
<
<
<
<
<







169
170
171
172
173
174
175










176
177
178
179
180
181
182
		return MODE_READWRITE;
	}

	return -1;
}
#endif











@implementation OFFile
+ (void)initialize
{
	if (self != [OFFile class])
		return;

#ifdef OF_WII
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

#ifdef OF_NINTENDO_SWITCH
	if (R_SUCCEEDED(romfsInit()))
		/*
		 * Errors are intentionally ignored, as it's possible we just
		 * have no romfs.
		 */
		initialized = true;
#endif
}

+ (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode
{
	return [[[self alloc] initWithPath: path mode: mode] autorelease];
}







|







193
194
195
196
197
198
199
200
201
202
203
204
205
206
207

#ifdef OF_NINTENDO_SWITCH
	if (R_SUCCEEDED(romfsInit()))
		/*
		 * Errors are intentionally ignored, as it's possible we just
		 * have no romfs.
		 */
		atexit((void (*)(void))romfsExit);
#endif
}

+ (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode
{
	return [[[self alloc] initWithPath: path mode: mode] autorelease];
}