ObjFW  Check-in [e1b2c4bb1e]

Overview
Comment:OF_ENSURE: Wrap in do / while (0)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e1b2c4bb1ef37cdaaaf752409b0e514bfe233be508434ff53fe359cfa33d1b25
User & Date: js on 2015-05-02 23:52:20
Other Links: manifest | tags
Context
2015-05-03
09:39
Improve OFKernelEventObserverTests check-in: 3791ec8e42 user: js tags: trunk
2015-05-02
23:52
OF_ENSURE: Wrap in do / while (0) check-in: e1b2c4bb1e user: js tags: trunk
21:46
FD_SETSIZE is not (maximum FD number + 1) on Win32 check-in: a2738e1a3d user: js tags: trunk
Changes

Modified src/macros.h from [d141131552] to [f975939415].

288
289
290
291
292
293
294

295
296
297
298
299







300
301
302
303
304
305
306
288
289
290
291
292
293
294
295





296
297
298
299
300
301
302
303
304
305
306
307
308
309







+
-
-
-
-
-
+
+
+
+
+
+
+







# define OF_PATH_DELIMITER_STRING @"\\"
# define OF_IS_PATH_DELIMITER(c) (c == '\\' || c == '/')
#endif
#define OF_PATH_CURRENT_DIRECTORY @"."
#define OF_PATH_PARENT_DIRECTORY @".."

#define OF_ENSURE(cond)							\
	do {								\
	if (!(cond)) {							\
		fprintf(stderr, "Failed to ensure condition in "	\
		    __FILE__ ":%d:\n" #cond "\n", __LINE__);		\
		abort();						\
	}
		if (!(cond)) {						\
			fprintf(stderr, "Failed to ensure condition "	\
			    "in " __FILE__ ":%d:\n" #cond "\n",		\
			    __LINE__);					\
			abort();					\
		}							\
	} while (0)

#define OF_UNRECOGNIZED_SELECTOR of_method_not_found(self, _cmd);
#define OF_INVALID_INIT_METHOD				\
	@try {						\
		[self doesNotRecognizeSelector: _cmd];	\
	} @catch (id e) {				\
		[self release];				\