Skip to content

Commit 9630cf1

Browse files
committed
SADLY: consider __objc_max
1 parent ef18759 commit 9630cf1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

encoding2.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ inline static void round_up(size_t *v, size_t b)
144144
*v += b - (*v % b);
145145
}
146146
}
147-
inline static size_t max(size_t v, size_t v2)
147+
inline static size_t __objc_max(size_t v, size_t v2)
148148
{
149149
return v>v2 ? v : v2;
150150
}
@@ -249,7 +249,7 @@ static const char *sizeof_union_field(const char *type, size_t *size)
249249
{
250250
size_t field_size = 0;
251251
const char *end = sizeof_type(type, &field_size);
252-
*size = max(*size, field_size);
252+
*size = __objc_max(*size, field_size);
253253
return end;
254254
}
255255

@@ -263,15 +263,15 @@ static const char *alignof_type(const char *type, size_t *align)
263263
#define APPLY_TYPE(typeName, name, capitalizedName, encodingChar) \
264264
case encodingChar:\
265265
{\
266-
*align = max((alignof(typeName) * 8), *align);\
266+
*align = __objc_max((alignof(typeName) * 8), *align);\
267267
return type + 1;\
268268
}
269269
#define NON_INTEGER_TYPES 1
270270
#define SKIP_ID 1
271271
#include "type_encoding_cases.h"
272272
case '@':
273273
{
274-
*align = max((alignof(id) * 8), *align);\
274+
*align = __objc_max((alignof(id) * 8), *align);\
275275
if (*(type+1) == '?')
276276
{
277277
type++;
@@ -288,7 +288,7 @@ static const char *alignof_type(const char *type, size_t *align)
288288
#define APPLY_TYPE(typeName, name, capitalizedName, encodingChar) \
289289
case encodingChar:\
290290
{\
291-
*align = max((alignof(_Complex typeName) * 8), *align);\
291+
*align = __objc_max((alignof(_Complex typeName) * 8), *align);\
292292
return type + 1;\
293293
}
294294
#include "type_encoding_cases.h"
@@ -327,7 +327,7 @@ static const char *alignof_type(const char *type, size_t *align)
327327
}
328328
case '^':
329329
{
330-
*align = max((alignof(void*) * 8), *align);
330+
*align = __objc_max((alignof(void*) * 8), *align);
331331
// All pointers look the same to me.
332332
size_t ignored = 0;
333333
// Skip the definition of the pointeee type.

0 commit comments

Comments
 (0)