Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004--2005, Google Inc. | 3 * Copyright 2004--2005, Google Inc. |
| 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 met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; | 45 } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; |
| 46 #endif // SECURITY_MANDATORY_LABEL_AUTHORITY | 46 #endif // SECURITY_MANDATORY_LABEL_AUTHORITY |
| 47 | 47 |
| 48 #undef SetPort | 48 #undef SetPort |
| 49 | 49 |
| 50 #include <string> | 50 #include <string> |
| 51 | 51 |
| 52 #include "talk/base/stringutils.h" | 52 #include "talk/base/stringutils.h" |
| 53 #include "talk/base/basictypes.h" | 53 #include "talk/base/basictypes.h" |
| 54 | 54 |
| 55 // This is to remove the dependency to ws2_32.dll especially for chrome. | |
|
Sergey Ulanov
2012/02/28 21:54:02
nit: please explain why we don't want to depend on
Ronghua Wu (Left Chromium)
2012/02/28 23:16:57
Done.
| |
| 56 // This is correct only on little-endian machines. | |
| 57 #include <stdlib.h> | |
|
Sergey Ulanov
2012/02/28 21:54:02
nit: move this include above, next to other system
Ronghua Wu (Left Chromium)
2012/02/28 23:16:57
Done.
| |
| 58 #define ntohl(x) _byteswap_ulong(x) | |
| 59 #define ntohs(x) _byteswap_ushort(x) | |
| 60 #define htonl(x) _byteswap_ulong(x) | |
| 61 #define htons(x) _byteswap_ushort(x) | |
| 62 | |
| 55 namespace talk_base { | 63 namespace talk_base { |
| 56 | 64 |
| 57 const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); | 65 const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); |
| 58 int win32_inet_pton(int af, const char* src, void *dst); | 66 int win32_inet_pton(int af, const char* src, void *dst); |
| 59 | 67 |
| 60 /////////////////////////////////////////////////////////////////////////////// | 68 /////////////////////////////////////////////////////////////////////////////// |
| 61 | 69 |
| 62 inline std::wstring ToUtf16(const char* utf8, size_t len) { | 70 inline std::wstring ToUtf16(const char* utf8, size_t len) { |
| 63 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); | 71 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); |
| 64 wchar_t* ws = STACK_ARRAY(wchar_t, len16); | 72 wchar_t* ws = STACK_ARRAY(wchar_t, len16); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 } | 132 } |
| 125 | 133 |
| 126 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); | 134 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); |
| 127 | 135 |
| 128 /////////////////////////////////////////////////////////////////////////////// | 136 /////////////////////////////////////////////////////////////////////////////// |
| 129 | 137 |
| 130 } // namespace talk_base | 138 } // namespace talk_base |
| 131 | 139 |
| 132 #endif // WIN32 | 140 #endif // WIN32 |
| 133 #endif // TALK_BASE_WIN32_H_ | 141 #endif // TALK_BASE_WIN32_H_ |
| OLD | NEW |