config: Introduce DEBUG_CONFIG macro for debug output of config
This commit is contained in:
parent
d0cf55e13a
commit
da6514a04a
@ -13,7 +13,15 @@
|
|||||||
|
|
||||||
#ifndef ECMULT_WINDOW_SIZE
|
#ifndef ECMULT_WINDOW_SIZE
|
||||||
# define ECMULT_WINDOW_SIZE 15
|
# define ECMULT_WINDOW_SIZE 15
|
||||||
|
# ifdef DEBUG_CONFIG
|
||||||
|
# pragma message DEBUG_CONFIG_MSG("ECMULT_WINDOW_SIZE undefined, assuming default value")
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_CONFIG
|
||||||
|
# pragma message DEBUG_CONFIG_DEF(ECMULT_WINDOW_SIZE)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Noone will ever need more than a window size of 24. The code might
|
/* Noone will ever need more than a window size of 24. The code might
|
||||||
* be correct for larger values of ECMULT_WINDOW_SIZE but this is not
|
* be correct for larger values of ECMULT_WINDOW_SIZE but this is not
|
||||||
* tested.
|
* tested.
|
||||||
|
@ -12,10 +12,19 @@
|
|||||||
|
|
||||||
#ifndef ECMULT_GEN_PREC_BITS
|
#ifndef ECMULT_GEN_PREC_BITS
|
||||||
# define ECMULT_GEN_PREC_BITS 4
|
# define ECMULT_GEN_PREC_BITS 4
|
||||||
|
# ifdef DEBUG_CONFIG
|
||||||
|
# pragma message DEBUG_CONFIG_MSG("ECMULT_GEN_PREC_BITS undefined, assuming default value")
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_CONFIG
|
||||||
|
# pragma message DEBUG_CONFIG_DEF(ECMULT_GEN_PREC_BITS)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if ECMULT_GEN_PREC_BITS != 2 && ECMULT_GEN_PREC_BITS != 4 && ECMULT_GEN_PREC_BITS != 8
|
#if ECMULT_GEN_PREC_BITS != 2 && ECMULT_GEN_PREC_BITS != 4 && ECMULT_GEN_PREC_BITS != 8
|
||||||
# error "Set ECMULT_GEN_PREC_BITS to 2, 4 or 8."
|
# error "Set ECMULT_GEN_PREC_BITS to 2, 4 or 8."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ECMULT_GEN_PREC_G(bits) (1 << bits)
|
#define ECMULT_GEN_PREC_G(bits) (1 << bits)
|
||||||
#define ECMULT_GEN_PREC_N(bits) (256 / bits)
|
#define ECMULT_GEN_PREC_N(bits) (256 / bits)
|
||||||
|
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
#define STR_(x) #x
|
||||||
|
#define STR(x) STR_(x)
|
||||||
|
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
|
||||||
|
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*fn)(const char *text, void* data);
|
void (*fn)(const char *text, void* data);
|
||||||
const void* data;
|
const void* data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user