diff options
author | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
commit | 1f457376b478257b88d4a857f5ec1b6155442dd7 (patch) | |
tree | 2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/dk4mai8dbl.ctr | |
parent | ac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff) |
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/dk4mai8dbl.ctr')
-rw-r--r-- | support/dktools/dk4mai8dbl.ctr | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/support/dktools/dk4mai8dbl.ctr b/support/dktools/dk4mai8dbl.ctr index 934270f057..cb132bd1ad 100644 --- a/support/dktools/dk4mai8dbl.ctr +++ b/support/dktools/dk4mai8dbl.ctr @@ -2,7 +2,7 @@ copyright owner = Dirk Krause copyright year = 2015-xxxx -license = bsd +SPDX-License-Identifier: BSD-3-Clause @@ -15,15 +15,27 @@ license = bsd */ #ifndef DK4CONF_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" +#else +#include <dktools-4/dk4conf.h> +#endif #endif #ifndef DK4TYPES_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4types.h" +#else +#include <dktools-4/dk4types.h> +#endif #endif #ifndef DK4ERROR_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4error.h" +#else +#include <dktools-4/dk4error.h> +#endif #endif #ifdef __cplusplus @@ -34,6 +46,8 @@ extern "C" { The function temporarily resets the LC_NUMERIC locale setting to "C" to retrieve the number and returns the setting to the original value before returning. + + CRT on Windows: Required. @param rp Address of result variable. @param src String to process. @param endptr Address of pointer variable. @@ -74,6 +88,14 @@ dk4ma_input_c8_double( %% module +#include "dk4conf.h" + +#if DK4_HAVE_ASSERT_H +#ifndef ASSERT_H_INCLUDED +#include <assert.h> +#define ASSERT_H_INCLUDED 1 +#endif +#endif #include "dk4mai8dbl.h" @@ -100,8 +122,13 @@ dk4ma_input_c8_double( #endif #endif -#if DK4_HAVE_MATH_H -#ifndef MATH_H_INCLUDED +#if DK4_HAVE_MATH_H +#ifndef MATH_H_INCLUDED +#if DK4_ON_WINDOWS +#ifndef _USE_MATH_DEFINES +#define _USE_MATH_DEFINES 1 +#endif +#endif #include <math.h> #define MATH_H_INCLUDED 1 #endif @@ -155,6 +182,10 @@ dk4ma_internal_input_c8_double( char *myend = NULL; int back = 0; int xerr = 0; +#if DK4_USE_ASSERT + assert(NULL != rp); + assert(NULL != src); +#endif if ((NULL != rp) && (NULL != src)) { errno = 0; #if DK4_HAVE_STRTOD @@ -214,6 +245,10 @@ dk4ma_internal_input_c8_double( #if DK4_USE_PRINTF_SCANF double val = 0.0; int back = 0; +#if DK4_USE_ASSERT + assert(NULL != rp); + assert(NULL != src); +#endif if ((NULL != rp) && (NULL != src)) { if (1 == sscanf(src, "%lf", &val)) { *rp = val; @@ -247,6 +282,10 @@ dk4ma_input_c8_double( char *oldloc = NULL; #endif int back = 0; +#if DK4_USE_ASSERT + assert(NULL != rp); + assert(NULL != src); +#endif #if (DK4_HAVE_SETLOCALE) && defined(LC_NUMERIC) oldloc = setlocale(LC_NUMERIC, NULL); (void)setlocale(LC_NUMERIC, locale_kw); |