Reformat
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
// vim:fileencoding=utf-8:foldmethod=marker
|
||||||
|
|
||||||
#include "./array.h"
|
#include "./array.h"
|
||||||
#include "../../common/assert/assert.h"
|
#include "../../common/assert/assert.h"
|
||||||
#include "../mem_allocator/mem_allocator.h"
|
#include "../mem_allocator/mem_allocator.h"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// vim:fileencoding=utf-8:foldmethod=marker
|
||||||
|
|
||||||
#ifndef ARRAY_H
|
#ifndef ARRAY_H
|
||||||
#define ARRAY_H
|
#define ARRAY_H
|
||||||
|
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ typedef const Str8 Str8RO;
|
|||||||
#ifdef WAPP_PLATFORM_CPP
|
#ifdef WAPP_PLATFORM_CPP
|
||||||
// Uses a lambda to achieve the same behaviour achieved by the C macro
|
// Uses a lambda to achieve the same behaviour achieved by the C macro
|
||||||
#define wapp_str8_buf(CAPACITY) ([&](){ \
|
#define wapp_str8_buf(CAPACITY) ([&](){ \
|
||||||
wapp_persist c8 buf[CAPACITY] = {}; \
|
wapp_persist c8 buf[CAPACITY] = {}; \
|
||||||
memset(buf, 0, CAPACITY); \
|
memset(buf, 0, CAPACITY); \
|
||||||
return Str8{CAPACITY, 0, buf}; \
|
return Str8{CAPACITY, 0, buf}; \
|
||||||
}())
|
}())
|
||||||
|
|
||||||
// Uses a lambda to achieve the same behaviour achieved by the C macro
|
// Uses a lambda to achieve the same behaviour achieved by the C macro
|
||||||
#define wapp_str8_lit(STRING) ([&]() { \
|
#define wapp_str8_lit(STRING) ([&]() { \
|
||||||
wapp_persist c8 buf[sizeof(STRING) * 2] = {}; \
|
wapp_persist c8 buf[sizeof(STRING) * 2] = {}; \
|
||||||
memcpy(buf, STRING, sizeof(STRING)); \
|
memcpy(buf, STRING, sizeof(STRING)); \
|
||||||
return Str8{(sizeof(STRING) - 1) * 2, sizeof(STRING) - 1, buf}; \
|
return Str8{(sizeof(STRING) - 1) * 2, sizeof(STRING) - 1, buf}; \
|
||||||
}())
|
}())
|
||||||
|
|||||||
Reference in New Issue
Block a user