Skip to content

Commit bbfffb1

Browse files
committed
[oslog-build-issues] Fixup tvos build issues.
1 parent 26731fb commit bbfffb1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

stdlib/public/SDK/os/os_trace_blob.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ os_trace_blob_grow(os_trace_blob_t ob, size_t hint)
8181
} else if (os_mul_overflow(ob->ob_size, 2, &size)) {
8282
size = ob->ob_maxsize;
8383
} else {
84-
size = MIN(ob->ob_maxsize, MAX(minsize, size));
84+
size = MIN((uint32_t)ob->ob_maxsize, MAX(minsize, size));
8585
}
8686
if (size > ob->ob_size) {
8787
if (ob->ob_flags & OS_TRACE_BLOB_NEEDS_FREE) {

stdlib/public/SDK/os/os_trace_blob.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef __BLOB_H__
1414
#define __BLOB_H__
1515

16+
#include <stdlib.h>
17+
#include <string.h>
1618
#include "thunks.h"
1719

1820
OS_ENUM(os_trace_blob_flags, uint16_t,

stdlib/public/SDK/os/thunks.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#define MIN(a, b) (((a)<(b))?(a):(b))
3131
#endif
3232

33+
#ifndef MAX
34+
#define MAX(a, b) (((a)>(b))?(a):(b))
35+
#endif
36+
3337
#ifndef OS_TRACE_INTERNAL_CRASH
3438
#define OS_TRACE_INTERNAL_CRASH(_ptr, _message) _swift_os_log_reportError(0, _message)
3539
#endif

0 commit comments

Comments
 (0)