libCom: Recognize hex literals in epicsStrtod()

Allows Windows and VxWorks to accept hex integers as a double.
This commit is contained in:
Andrew Johnson
2013-12-02 11:12:19 -06:00
parent bd82554299
commit 78a4e462d5
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -60,6 +60,12 @@ epicsShareFunc double epicsStrtod(const char *str, char **endp)
cp++;
}
if (epicsStrnCaseCmp("0x", cp, 2) == 0) {
if (negative)
return strtol(str, endp, 16);
else
return strtoul(str, endp, 16);
}
if (!isalpha((int)*cp))
return strtod(str, endp);