-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The generic min macro in util.h is too common and can conflict with other libraries. Rename it to nvme_min to avoid pollution. Before renaming the macro, the cpp's std::min will fail to compile. ``` ./test/cpp.cc: In function ‘int min_compile_test()’: ../src/nvme/util.h:563:19: error: expected unqualified-id before ‘(’ token 563 | #define min(x, y) ((x) > (y) ? (y) : (x)) ``` Signed-off-by: Jian Zhang <[email protected]>
- Loading branch information
1 parent
e9c6fe6
commit 79a7219
Showing
5 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,20 @@ | |
* Authors: Keith Busch <[email protected]> | ||
*/ | ||
|
||
#include <algorithm> | ||
#include <iostream> | ||
#include <libnvme.h> | ||
|
||
static int min_compile_test() | ||
{ | ||
return std::min(1, 2); | ||
} | ||
|
||
static int max_compile_test() | ||
{ | ||
return std::max(1, 2); | ||
} | ||
|
||
int main() | ||
{ | ||
nvme_root_t r; | ||
|
@@ -62,5 +73,8 @@ int main() | |
std::cout << "\n"; | ||
nvme_free_tree(r); | ||
|
||
min_compile_test(); | ||
max_compile_test(); | ||
|
||
return 0; | ||
} |