ObjFW  Check-in [d2dc015fd3]

Overview
Comment:OFMethodSignature: Fix Win32 struct alignment
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d2dc015fd3be9e7f4054a5a165503c21f9e5df2d4e7bdca27309138a3d850b66
User & Date: js on 2018-06-19 22:49:17
Other Links: manifest | tags
Context
2018-06-23
19:09
ofarc: Show more details for LHA archives check-in: 1ace482d39 user: js tags: trunk
2018-06-19
22:49
OFMethodSignature: Fix Win32 struct alignment check-in: d2dc015fd3 user: js tags: trunk
22:35
.travis.yml: Separate jobs for iOS check-in: 137fee6ddd user: js tags: trunk
Changes

Modified src/OFMethodSignature.m from [dd63fb02de] to [ea9c0d1262].

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
		break;
	case 'l':
	case 'L':
		align = OF_ALIGNOF(long);
		break;
	case 'q':
	case 'Q':
#ifdef OF_X86
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(long long);
		break;
#ifdef __SIZEOF_INT128__
	case 't':
	case 'T':
		align = __extension__ OF_ALIGNOF(__int128);
		break;
#endif
	case 'f':
		align = OF_ALIGNOF(float);
		break;
	case 'd':
#ifdef OF_X86
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(double);
		break;
	case 'D':
#ifdef OF_X86
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(long double);
		break;
	case 'B':







|
















|







|







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
		break;
	case 'l':
	case 'L':
		align = OF_ALIGNOF(long);
		break;
	case 'q':
	case 'Q':
#if defined(OF_X86) && !defined(OF_WINDOWS)
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(long long);
		break;
#ifdef __SIZEOF_INT128__
	case 't':
	case 'T':
		align = __extension__ OF_ALIGNOF(__int128);
		break;
#endif
	case 'f':
		align = OF_ALIGNOF(float);
		break;
	case 'd':
#if defined(OF_X86) && !defined(OF_WINDOWS)
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(double);
		break;
	case 'D':
#if defined(OF_X86) && !defined(OF_WINDOWS)
		if (inStruct)
			align = 4;
		else
#endif
			align = OF_ALIGNOF(long double);
		break;
	case 'B':
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
			@throw [OFInvalidFormatException exception];

		switch (**type) {
		case 'f':
			align = OF_ALIGNOF(float _Complex);
			break;
		case 'd':
# ifdef OF_X86
			if (inStruct)
				align = 4;
			else
#endif
				align = OF_ALIGNOF(double _Complex);
			break;
		case 'D':
			align = OF_ALIGNOF(long double _Complex);
			break;
		default:
			@throw [OFInvalidFormatException exception];







|



|







253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
			@throw [OFInvalidFormatException exception];

		switch (**type) {
		case 'f':
			align = OF_ALIGNOF(float _Complex);
			break;
		case 'd':
# if defined(OF_X86) && !defined(OF_WINDOWS)
			if (inStruct)
				align = 4;
			else
# endif
				align = OF_ALIGNOF(double _Complex);
			break;
		case 'D':
			align = OF_ALIGNOF(long double _Complex);
			break;
		default:
			@throw [OFInvalidFormatException exception];