+ // Hexadecimal prefix: use base 16 if auto-detecting.
+ if ( base == 0 )
+ base = 16;
+
+ // If we do use base 16, just skip "x" as well.
+ if ( base == 16 )
+ {
+ ++i;
+ }
+ else // Not using base 16
+ {
+ // Then it's an error.
+ if ( endptr )
+ *endptr = (T*) nptr;
+ wxSET_ERRNO(EINVAL);
+ return sum;
+ }