/[pcre]/code/trunk/pcrecpp.cc
ViewVC logotype

Diff of /code/trunk/pcrecpp.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 253 by ph10, Mon Sep 17 10:51:30 2007 UTC revision 257 by ph10, Wed Sep 19 09:11:19 2007 UTC
# Line 33  Line 33 
33  #include "config.h"  #include "config.h"
34  #endif  #endif
35    
 #ifdef HAVE_WINDOWS_H  
 #define HAVE_STRTOQ 1  
 #define strtoll     _strtoui64  
 #define strtoull    _strtoi64  
 #endif  
   
36  #include <stdlib.h>  #include <stdlib.h>
37  #include <stdio.h>  #include <stdio.h>
38  #include <ctype.h>  #include <ctype.h>
# Line 717  bool Arg::parse_short_radix(const char* Line 711  bool Arg::parse_short_radix(const char*
711    long r;    long r;
712    if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse    if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
713    if (r < SHRT_MIN || r > SHRT_MAX) return false;       // Out of range    if (r < SHRT_MIN || r > SHRT_MAX) return false;       // Out of range
714    *(reinterpret_cast<short*>(dest)) = r;    *(reinterpret_cast<short*>(dest)) = static_cast<short>(r);
715    return true;    return true;
716  }  }
717    
# Line 728  bool Arg::parse_ushort_radix(const char* Line 722  bool Arg::parse_ushort_radix(const char*
722    unsigned long r;    unsigned long r;
723    if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse    if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
724    if (r > USHRT_MAX) return false;                      // Out of range    if (r > USHRT_MAX) return false;                      // Out of range
725    *(reinterpret_cast<unsigned short*>(dest)) = r;    *(reinterpret_cast<unsigned short*>(dest)) = static_cast<unsigned short>(r);
726    return true;    return true;
727  }  }
728    
# Line 770  bool Arg::parse_longlong_radix(const cha Line 764  bool Arg::parse_longlong_radix(const cha
764    long long r = strtoq(str, &end, radix);    long long r = strtoq(str, &end, radix);
765  #elif defined HAVE_STRTOLL  #elif defined HAVE_STRTOLL
766    long long r = strtoll(str, &end, radix);    long long r = strtoll(str, &end, radix);
767    #elif defined HAVE__STRTOI64
768      long long r = _strtoi64(str, &end, radix);
769  #else  #else
770  #error parse_longlong_radix: cannot convert input to a long-long  #error parse_longlong_radix: cannot convert input to a long-long
771  #endif  #endif
# Line 797  bool Arg::parse_ulonglong_radix(const ch Line 793  bool Arg::parse_ulonglong_radix(const ch
793    unsigned long long r = strtouq(str, &end, radix);    unsigned long long r = strtouq(str, &end, radix);
794  #elif defined HAVE_STRTOLL  #elif defined HAVE_STRTOLL
795    unsigned long long r = strtoull(str, &end, radix);    unsigned long long r = strtoull(str, &end, radix);
796    #elif defined HAVE__STRTOI64
797      unsigned long long r = _strtoui64(str, &end, radix);
798  #else  #else
799  #error parse_ulonglong_radix: cannot convert input to a long-long  #error parse_ulonglong_radix: cannot convert input to a long-long
800  #endif  #endif

Legend:
Removed from v.253  
changed lines
  Added in v.257

  ViewVC Help
Powered by ViewVC 1.1.5