diff options
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc index f1dc1cb..05d6f88 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -235,6 +235,17 @@ parse_double(const char* option_name, const char* arg, double* retval) } void +parse_percent(const char* option_name, const char* arg, double* retval) +{ + char* endptr; + *retval = strtod(arg, &endptr) / 100.0; + if (*endptr != '\0') + gold_fatal(_("%s: invalid option value " + "(expected a floating point number): %s"), + option_name, arg); +} + +void parse_string(const char* option_name, const char* arg, const char** retval) { if (*arg == '\0') |