diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/kalmia.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/kalmia.h b/include/kalmia.h index 31aff1e..48a608f 100644 --- a/include/kalmia.h +++ b/include/kalmia.h @@ -45,7 +45,7 @@ #ifndef KALMIA_H #define KALMIA_H -#include <stddef.h> +#include <stdlib.h> /* kalmia uses semantic versioning (semver.org) */ #define KALMIA_VERSION_MAJOR 0 @@ -53,6 +53,16 @@ #define KALMIA_VERSION_PATCH 0 +/* determine precision */ +#ifdef KALMIA_USE_DOUBLE +typedef double ka_real_t; +#define KA_STR_TO_REAL(nptr, end) strtod(nptr, end) +#else +typedef float ka_real_t; +#define KA_STR_TO_REAL(nptr, end) strtof(nptr, end) +#endif + + /* internal buffer size for strings/sids */ #ifndef KA_BUF_SIZE #define KA_BUF_SIZE 128 @@ -61,6 +71,8 @@ /* format data structures */ -typedef double ka_matrix_t[16]; +typedef ka_real_t ka_matrix_t[16]; + + #endif |