Skip to content

Commit 5bbec00

Browse files
authored
Merge pull request #2308 from mazunki/fix-redefine-pagesize
fix warning: remove redefinition of PAGE_SIZE
2 parents 94db2b3 + c975d1b commit 5bbec00

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

api/virtio/virtio.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@
3434

3535
#include "../hw/pci_device.hpp"
3636
#include <net/inet_common.hpp>
37+
#include <limits.h>
3738
#include <stdint.h>
3839
#include <vector>
3940

40-
#define PAGE_SIZE 4096
41+
#if ! defined(PAGE_SIZE)
42+
#error "PAGE_SIZE not defined. Expected it to be defined by musl's limits.h"
43+
#endif
4144

4245
#define VIRTIO_F_NOTIFY_ON_EMPTY 24
4346
#define VIRTIO_F_ANY_LAYOUT 27

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if (DEBUG_INFO)
4646
set(NO_DEBUG "")
4747
endif()
4848

49-
set(CMAKE_CXX_FLAGS "-g -O0 -std=c++20 -Wall -Wextra -Wno-frame-address -Wno-unused-function -Wno-int-to-pointer-cast -D__id_t_defined -DUNITTESTS -DURI_THROW_ON_ERROR ${NO_INFO} ${NO_DEBUG} -DGSL_THROW_ON_CONTRACT_VIOLATION -Dlest_FEATURE_AUTO_REGISTER=1 -DHAVE_LEST_MAIN")
49+
set(CMAKE_CXX_FLAGS "-g -O0 -std=c++20 -Wall -Wextra -Wno-frame-address -Wno-unused-function -Wno-int-to-pointer-cast -D__id_t_defined -DUNITTESTS -DURI_THROW_ON_ERROR ${NO_INFO} ${NO_DEBUG} -DGSL_THROW_ON_CONTRACT_VIOLATION -Dlest_FEATURE_AUTO_REGISTER=1 -DHAVE_LEST_MAIN -DPAGE_SIZE=4096")
5050

5151
set(TEST ${CMAKE_CURRENT_SOURCE_DIR})
5252

0 commit comments

Comments
 (0)