Skip to content

Commit 638b89d

Browse files
committed
runtime: use std::max_align_t over max_align_t (NFC)
MSVC does not provide a full C99 environment. Use the C++ equivalent spelling for the value. This allows the build to succeed on Windows.
1 parent 869931c commit 638b89d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/runtime/Casting.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "SwiftValue.h"
4242
#endif
4343

44+
#include <cstddef>
4445
#include <cstring>
4546
#include <type_traits>
4647

@@ -2667,7 +2668,7 @@ static bool _dynamicCastClassToValueViaObjCBridgeable(
26672668
// Allocate a buffer to store the T? returned by bridging.
26682669
// The extra byte is for the tag.
26692670
const std::size_t inlineValueSize = 3 * sizeof(void*);
2670-
alignas(max_align_t) char inlineBuffer[inlineValueSize + 1];
2671+
alignas(std::max_align_t) char inlineBuffer[inlineValueSize + 1];
26712672
void *optDestBuffer;
26722673
if (targetType->getValueWitnesses()->getStride() <= inlineValueSize) {
26732674
// Use the inline buffer.

0 commit comments

Comments
 (0)