diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index c41cdb1..c93c876 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -58,6 +58,18 @@ SOFTWARE. #include #endif +#ifndef ARGPARSE_CUSTOM_STRTOF +#define ARGPARSE_CUSTOM_STRTOF strtof +#endif + +#ifndef ARGPARSE_CUSTOM_STRTOD +#define ARGPARSE_CUSTOM_STRTOD strtod +#endif + +#ifndef ARGPARSE_CUSTOM_STRTOLD +#define ARGPARSE_CUSTOM_STRTOLD strtold +#endif + namespace argparse { namespace details { // namespace for helper methods @@ -347,9 +359,10 @@ template struct parse_number { namespace { template inline const auto generic_strtod = nullptr; -template <> inline const auto generic_strtod = strtof; -template <> inline const auto generic_strtod = strtod; -template <> inline const auto generic_strtod = strtold; +template <> inline const auto generic_strtod = ARGPARSE_CUSTOM_STRTOF; +template <> inline const auto generic_strtod = ARGPARSE_CUSTOM_STRTOD; +template <> +inline const auto generic_strtod = ARGPARSE_CUSTOM_STRTOLD; } // namespace