1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/littlefs: use static_assert() instead of BUILD_BUG_ON()

This commit is contained in:
Marian Buschsieweke 2021-11-25 09:32:26 +01:00
parent 3aac469e61
commit b76ba4bbfd
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -18,6 +18,7 @@
* @}
*/
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#include <inttypes.h>
@ -25,8 +26,6 @@
#include "fs/littlefs_fs.h"
#include "kernel_defines.h"
#define ENABLE_DEBUG 0
#include <debug.h>
@ -170,8 +169,10 @@ static int _mount(vfs_mount_t *mountp)
{
/* if one of the lines below fail to compile you probably need to adjust
vfs buffer sizes ;) */
BUILD_BUG_ON(VFS_DIR_BUFFER_SIZE < sizeof(lfs_dir_t));
BUILD_BUG_ON(VFS_FILE_BUFFER_SIZE < sizeof(lfs_file_t));
static_assert(VFS_DIR_BUFFER_SIZE >= sizeof(lfs_dir_t),
"lfs_dir_t must fit in VFS_DIR_BUFFER_SIZE");
static_assert(VFS_FILE_BUFFER_SIZE >= sizeof(lfs_file_t),
"lfs_file_t must fit in VFS_FILE_BUFFER_SIZE");
littlefs_desc_t *fs = mountp->private_data;