|
22 | 22 | * along with this program; if not, write to the Free Software |
23 | 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
24 | 24 | */ |
25 | | -#ifndef _WOLFBOOT_USER_SETTINGS_H_ |
26 | | -#define _WOLFBOOT_USER_SETTINGS_H_ |
| 25 | +#ifndef WOLFBOOT_USER_SETTINGS_H |
| 26 | +#define WOLFBOOT_USER_SETTINGS_H |
| 27 | + |
| 28 | +/* This is the wolfBoot embedded target user settings. |
| 29 | + * |
| 30 | + * See also settings in [WOLFBOOT_ROOT]/tools/keytools |
| 31 | + * |
| 32 | + * When in question, define DEBUG_SIGNTOOL and optionally WOLFBOOT_SHOW_INCLUDE |
| 33 | + */ |
| 34 | + |
| 35 | +/* During development in new environment, ensure the expected user settings is used: */ |
| 36 | +#ifdef WOLFBOOT_SHOW_INCLUDE |
| 37 | + #ifdef __GNUC__ /* GCC compiler */ |
| 38 | + #pragma message "===============include/user_settings.h" |
| 39 | + #elif defined(_MSC_VER) /* Microsoft Visual C++ compiler */ |
| 40 | + #pragma message("===============include/user_settings.h") |
| 41 | + #else |
| 42 | + #warning "===============include/user_settings.h" |
| 43 | + #endif |
| 44 | +#endif /* WOLFBOOT_SHOW_INCLUDE user_settings message */ |
| 45 | + |
| 46 | +#if defined(_MSC_VER) |
| 47 | + /* MSVC and clang-cl both define _MSC_VER */ |
| 48 | + #ifndef WOLFSSL_HAVE_MIN |
| 49 | + #define WOLFSSL_HAVE_MIN |
| 50 | + #endif |
| 51 | + #ifndef WOLFSSL_HAVE_MAX |
| 52 | + #define WOLFSSL_HAVE_MAX |
| 53 | + #endif |
| 54 | + |
| 55 | + /* Really keep Windows headers from redefining min/max */ |
| 56 | + #ifndef NOMINMAX |
| 57 | + #define NOMINMAX 1 |
| 58 | + #endif |
| 59 | +#endif |
27 | 60 |
|
28 | 61 | #ifdef WOLFBOOT_PKCS11_APP |
29 | 62 | # include "test-app/wcs/user_settings.h" |
30 | 63 | #else |
31 | 64 |
|
| 65 | +/* The target.h is a device-specific, typically a generated file. |
| 66 | + * CMake configures from `include/target.h.in` into ${CMAKE_CURRENT_BINARY_DIR} |
| 67 | + * |
| 68 | + * See also the sample in [WOLFBOOT_ROOT]/tools/unit-tests/target.h */ |
32 | 69 | #include <target.h> |
33 | 70 |
|
34 | 71 | /* System */ |
@@ -330,7 +367,9 @@ extern int tolower(int c); |
330 | 367 |
|
331 | 368 | /* SP Math needs to understand long long */ |
332 | 369 | # ifndef ULLONG_MAX |
333 | | -# define ULLONG_MAX 18446744073709551615ULL |
| 370 | +# ifndef _MSC_VER |
| 371 | +# define ULLONG_MAX 18446744073709551615ULL |
| 372 | +# endif |
334 | 373 | # endif |
335 | 374 | #endif |
336 | 375 |
|
@@ -586,4 +625,4 @@ extern int tolower(int c); |
586 | 625 | # define WOLFSSL_PEM_TO_DER |
587 | 626 | #endif |
588 | 627 |
|
589 | | -#endif /* !_WOLFBOOT_USER_SETTINGS_H_ */ |
| 628 | +#endif /* !WOLFBOOT_USER_SETTINGS_H */ |
0 commit comments