ObjFW  Check-in [61369b9d26]

Overview
Comment:macros.h: Never define static_assert to assert

static_asserts can be used in places where asserts won't work and take
two parameters, while asserts only take one.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 61369b9d26f073354d636873a07d82008a84608eb72eceb40b8b1a4ed794fb73
User & Date: js on 2014-03-19 18:05:42
Other Links: manifest | tags
Context
2014-03-22
17:56
Generalize runtime/hashtable.m check-in: 8d930f2067 user: js tags: trunk
2014-03-19
18:05
macros.h: Never define static_assert to assert check-in: 61369b9d26 user: js tags: trunk
2014-03-18
22:53
OFSystemInfo: Fix compilation check-in: 8e4f4567d3 user: js tags: trunk
Changes

Modified src/macros.h from [76ff6117a8] to [9ad949e286].

118
119
120
121
122
123
124
125
126


127
128

129
130
131
132
133
134
135
136
137
138
118
119
120
121
122
123
124


125
126


127



128
129
130
131
132
133
134







-
-
+
+
-
-
+
-
-
-







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

#if __STDC_VERSION__ >= 201112L
# /* C11 compiler, but old libc */
#if __STDC_VERSION__ >= 201112L && !defined(static_assert)
/* C11 compiler, but old libc */
# ifndef static_assert
#  define static_assert _Static_assert
# define static_assert _Static_assert
# endif
#else
# define static_assert assert
#endif

#if !defined(_WIN32) && !defined(__DJGPP__)
# define OF_PATH_DELIMITER '/'
# define OF_PATH_DELIMITER_STRING @"/"
# define OF_IS_PATH_DELIMITER(c) (c == '/')
#else