mirror of https://github.com/ARMmbed/mbed-os.git
Use MBED_STATIC_ASSERT instead of static_assert
parent
199d108063
commit
af37520e42
|
@ -828,7 +828,7 @@ std::FILE *mbed_fdopen(FileHandle *fh, const char *mode)
|
||||||
{
|
{
|
||||||
// This is to avoid scanf(buf, ":%.4s", fh) and the bloat it brings.
|
// This is to avoid scanf(buf, ":%.4s", fh) and the bloat it brings.
|
||||||
char buf[2 + sizeof(fh) + 1]; /* :(pointer) + null byte */
|
char buf[2 + sizeof(fh) + 1]; /* :(pointer) + null byte */
|
||||||
static_assert(sizeof(buf) == 7, "Pointers should be 4 bytes.");
|
MBED_STATIC_ASSERT(sizeof(buf) == 7, "Pointers should be 4 bytes.");
|
||||||
buf[0] = ':';
|
buf[0] = ':';
|
||||||
memcpy(buf + 1, &fh, sizeof(fh));
|
memcpy(buf + 1, &fh, sizeof(fh));
|
||||||
buf[1 + sizeof(fh)] = '\0';
|
buf[1 + sizeof(fh)] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue