| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008, Google Inc. | 2 * Copyright 2008, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 | 32 |
| 33 /* | 33 /* |
| 34 * portability macros, etc. for string related stuff | 34 * portability macros, etc. for string related stuff |
| 35 */ | 35 */ |
| 36 | 36 |
| 37 #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ | 37 #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ |
| 38 #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ 1 | 38 #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ 1 |
| 39 | 39 |
| 40 #include <string.h> | 40 #include <string.h> |
| 41 #include "native_client/src/include/nacl_defines.h" |
| 41 | 42 |
| 42 typedef char utf8char_t; | 43 typedef char utf8char_t; |
| 43 | 44 |
| 44 #if NACL_OSX | 45 #if NACL_OSX |
| 45 /* NOTE:: Mac doesn't define strnlen in the headers. */ | 46 /* NOTE:: Mac doesn't define strnlen in the headers. */ |
| 46 #if defined( __cplusplus) | 47 #if defined( __cplusplus) |
| 47 extern "C" | 48 extern "C" |
| 48 #endif | 49 #endif |
| 49 size_t strnlen(const char* str, size_t max); | 50 size_t strnlen(const char* str, size_t max); |
| 50 #endif | 51 #endif |
| 51 | 52 |
| 52 #if NACL_WINDOWS | 53 #if NACL_WINDOWS |
| 53 /* disable warnings for deprecated strncpy */ | 54 /* disable warnings for deprecated strncpy */ |
| 54 #pragma warning(disable : 4996) | 55 #pragma warning(disable : 4996) |
| 55 | 56 |
| 56 #define STRDUP _strdup | 57 #define STRDUP _strdup |
| 57 #define STRTOLL _strtoi64 | 58 #define STRTOLL _strtoi64 |
| 58 #define STRTOULL _strtoui64 | 59 #define STRTOULL _strtoui64 |
| 59 | 60 |
| 60 #else | 61 #else |
| 61 | 62 |
| 62 #define STRDUP strdup | 63 #define STRDUP strdup |
| 63 #define STRTOLL strtoll | 64 #define STRTOLL strtoll |
| 64 #define STRTOULL strtoull | 65 #define STRTOULL strtoull |
| 65 | 66 |
| 66 #endif | 67 #endif |
| 67 | 68 |
| 68 #endif /* NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ */ | 69 #endif /* NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ */ |
| OLD | NEW |