ObjFW  Check-in [ff538c8d26]

Overview
Comment:Handle strerror_r being different with _GNU_SOURCE
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ff538c8d2670096424f3c92b404533974630473ba9b18ddff37843a4a7172dce
User & Date: js on 2017-03-12 02:34:46
Other Links: manifest | tags
Context
2017-03-12
23:40
Fix compilation with --disable-files check-in: 1bf4f2e210 user: js tags: trunk
02:34
Handle strerror_r being different with _GNU_SOURCE check-in: ff538c8d26 user: js tags: trunk
01:42
Define select() to net_select() on Wii check-in: 0ce4eeb439 user: js tags: trunk
Changes

Modified src/exceptions/OFException.m from [681ad6119e] to [860e2e36ac].

181
182
183
184
185
186
187









188

189
190
191
192
193
194
195
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

197
198
199
200
201
202
203
204







+
+
+
+
+
+
+
+
+
-
+







	case EUSERS:
		return @"EUSERS";
	case EWOULDBLOCK:
		return @"EWOULDBLOCK";
	}
#endif

#if defined(HAVE_STRERROR_R) && defined(_GNU_SOURCE)
	/* glibc uses a different strerror_r when _GNU_SOURCE is defined */
	char *string;

	if ((string = strerror_r(errNo, buffer, 256)) == NULL)
		return @"Unknown error (strerror_r failed)";

	ret = [OFString stringWithCString: string
				 encoding: [OFLocalization encoding]];
#ifdef HAVE_STRERROR_R
#elif defined(HAVE_STRERROR_R)
	if (strerror_r(errNo, buffer, 256) != 0)
		return @"Unknown error (strerror_r failed)";

	ret = [OFString stringWithCString: buffer
				 encoding: [OFLocalization encoding]];
#else
# ifdef OF_HAVE_THREADS