-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
75 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ internal | |
color | ||
log | ||
enum | ||
white | ||
::: |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# White magic | ||
|
||
:::{doxygenfile} white.h | ||
::: |
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 |
---|---|---|
|
@@ -22,5 +22,6 @@ | |
* @code{.c} | ||
* prefix_name_2 | ||
* @endcode | ||
* @since 0.2 | ||
*/ | ||
#define JOIN(...) FOLD(JOIN2 __VA_OPT__(,) __VA_ARGS__) |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
/** | ||
* @file | ||
* White magic: Straightforward macros | ||
*/ | ||
|
||
/** | ||
* Number of elements of a C array. | ||
* | ||
* __Example__ | ||
* @code{.c} | ||
* short foo = {21, 84, 57}; | ||
* unsigned length = ARRAY_LENGTH(foo); | ||
* @endcode | ||
* Will result in `length = 3` | ||
* @since 0.2 | ||
*/ | ||
#define ARRAY_LENGTH(ARRAY) (sizeof(ARRAY) / sizeof(*(ARRAY))) | ||
|
||
/** Highest of two numbers */ | ||
#define max(A, B) ({ typeof(A) _a = (A); typeof(B) _b = (B); _a >= _b ? _a : _b; }) | ||
|
||
/** Lowest of two numbers */ | ||
#define min(A, B) ({ typeof(A) _a = (A); typeof(B) _b = (B); _a <= _b ? _a : _b; }) |