OLD | NEW |
1 /* Copyright (c) 2007, Google Inc. | 1 /* Copyright (c) 2007, Google Inc. |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 int tv_nsec; | 426 int tv_nsec; |
427 }; | 427 }; |
428 #endif | 428 #endif |
429 | 429 |
430 inline int nanosleep(const struct timespec *req, struct timespec *rem) { | 430 inline int nanosleep(const struct timespec *req, struct timespec *rem) { |
431 Sleep(req->tv_sec * 1000 + req->tv_nsec / 1000000); | 431 Sleep(req->tv_sec * 1000 + req->tv_nsec / 1000000); |
432 return 0; | 432 return 0; |
433 } | 433 } |
434 | 434 |
435 #ifndef __MINGW32__ | 435 #ifndef __MINGW32__ |
| 436 #if _MSC_VER < 1800 // Not required >= VS2013. |
436 inline long long int strtoll(const char *nptr, char **endptr, int base) { | 437 inline long long int strtoll(const char *nptr, char **endptr, int base) { |
437 return _strtoi64(nptr, endptr, base); | 438 return _strtoi64(nptr, endptr, base); |
438 } | 439 } |
439 inline unsigned long long int strtoull(const char *nptr, char **endptr, | 440 inline unsigned long long int strtoull(const char *nptr, char **endptr, |
440 int base) { | 441 int base) { |
441 return _strtoui64(nptr, endptr, base); | 442 return _strtoui64(nptr, endptr, base); |
442 } | 443 } |
443 inline long long int strtoq(const char *nptr, char **endptr, int base) { | 444 inline long long int strtoq(const char *nptr, char **endptr, int base) { |
444 return _strtoi64(nptr, endptr, base); | 445 return _strtoi64(nptr, endptr, base); |
445 } | 446 } |
| 447 #endif |
446 inline unsigned long long int strtouq(const char *nptr, char **endptr, | 448 inline unsigned long long int strtouq(const char *nptr, char **endptr, |
447 int base) { | 449 int base) { |
448 return _strtoui64(nptr, endptr, base); | 450 return _strtoui64(nptr, endptr, base); |
449 } | 451 } |
450 inline long long atoll(const char *nptr) { | 452 inline long long atoll(const char *nptr) { |
451 return _atoi64(nptr); | 453 return _atoi64(nptr); |
452 } | 454 } |
453 #endif | 455 #endif |
454 | 456 |
455 #define __THROW throw() | 457 #define __THROW throw() |
(...skipping 12 matching lines...) Expand all Loading... |
468 */ | 470 */ |
469 #define GOOGLE_MAYBE_THREADS_H_ 1 | 471 #define GOOGLE_MAYBE_THREADS_H_ 1 |
470 | 472 |
471 | 473 |
472 #endif /* _WIN32 */ | 474 #endif /* _WIN32 */ |
473 | 475 |
474 #undef inline | 476 #undef inline |
475 #undef EXTERN_C | 477 #undef EXTERN_C |
476 | 478 |
477 #endif /* GOOGLE_BASE_WINDOWS_H_ */ | 479 #endif /* GOOGLE_BASE_WINDOWS_H_ */ |
OLD | NEW |