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 29 matching lines...) Expand all Loading... |
40 // Add defines that we use if we are compiling against older sdks | 40 // Add defines that we use if we are compiling against older sdks |
41 #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) | 41 #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) |
42 #define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) | 42 #define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) |
43 typedef struct _TOKEN_MANDATORY_LABEL { | 43 typedef struct _TOKEN_MANDATORY_LABEL { |
44 SID_AND_ATTRIBUTES Label; | 44 SID_AND_ATTRIBUTES Label; |
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 <stdlib.h> |
50 #include <string> | 51 #include <string> |
51 | 52 |
52 #include "talk/base/stringutils.h" | 53 #include "talk/base/stringutils.h" |
53 #include "talk/base/basictypes.h" | 54 #include "talk/base/basictypes.h" |
54 | 55 |
| 56 // This is to remove the dependency to ws2_32.dll especially for chrome, |
| 57 // where we don't load the ws2_32.dll in the render process. |
| 58 // This is correct only on little-endian machines. |
| 59 #define ntohl(x) _byteswap_ulong(x) |
| 60 #define ntohs(x) _byteswap_ushort(x) |
| 61 #define htonl(x) _byteswap_ulong(x) |
| 62 #define htons(x) _byteswap_ushort(x) |
| 63 |
55 namespace talk_base { | 64 namespace talk_base { |
56 | 65 |
57 const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); | 66 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); | 67 int win32_inet_pton(int af, const char* src, void *dst); |
59 | 68 |
60 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
61 | 70 |
62 inline std::wstring ToUtf16(const char* utf8, size_t len) { | 71 inline std::wstring ToUtf16(const char* utf8, size_t len) { |
63 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); | 72 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); |
64 wchar_t* ws = STACK_ARRAY(wchar_t, len16); | 73 wchar_t* ws = STACK_ARRAY(wchar_t, len16); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 133 } |
125 | 134 |
126 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); | 135 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); |
127 | 136 |
128 /////////////////////////////////////////////////////////////////////////////// | 137 /////////////////////////////////////////////////////////////////////////////// |
129 | 138 |
130 } // namespace talk_base | 139 } // namespace talk_base |
131 | 140 |
132 #endif // WIN32 | 141 #endif // WIN32 |
133 #endif // TALK_BASE_WIN32_H_ | 142 #endif // TALK_BASE_WIN32_H_ |
OLD | NEW |