- Timestamp:
- 05/29/11 21:59:51 (14 years ago)
- Location:
- ps/trunk/source
- Files:
-
- 4 deleted
- 4 edited
-
lib/posix/posix.h (modified) (1 diff)
-
lib/posix/posix_sock.h (deleted)
-
lib/sysdep/os/win/win.h (modified) (1 diff)
-
lib/sysdep/os/win/wposix/wsock.cpp (deleted)
-
lib/sysdep/os/win/wposix/wsock.h (deleted)
-
lib/sysdep/os/win/wposix/wsock_internal.h (deleted)
-
ps/CStr.cpp (modified) (3 diffs)
-
ps/Util.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/lib/posix/posix.h
r9369 r9572 75 75 //#include "lib/posix/posix_mman.h" 76 76 //#include "lib/posix/posix_pthread.h" 77 //#include "lib/posix/posix_sock.h"78 77 //#include "lib/posix/posix_time.h" 79 78 //#include "lib/posix/posix_utsname.h" -
ps/trunk/source/lib/sysdep/os/win/win.h
r7316 r9572 33 33 34 34 // Win32 socket declarations aren't portable (e.g. problems with socklen_t) 35 // => skip winsock.h; posix_sock.h should be usedinstead.35 // => skip winsock.h; use curl or enet library instead. 36 36 #define _WINSOCKAPI_ 37 37 -
ps/trunk/source/ps/CStr.cpp
r9410 r9572 27 27 #define CStr_CPP_FIRST 28 28 29 #include "lib/posix/posix_sock.h" // htons, ntohs30 29 #include "lib/fnv_hash.h" 31 30 #include "lib/utf8.h" 31 #include "lib/byte_order.h" 32 32 #include "network/Serialization.h" 33 33 #include <cassert> … … 447 447 size_t i = 0; 448 448 for (i = 0; i < len; i++) 449 *(u16 *)(buffer + i*2) = htons((*this)[i]); // convert to network order (big-endian) 449 { 450 const u16 bigEndian = to_be16((*this)[i]); 451 *(u16 *)(buffer + i*2) = bigEndian; 452 } 450 453 *(u16 *)(buffer + i*2) = 0; 451 454 return buffer + len*2 + 2; … … 463 466 std::wstring::iterator str = begin(); 464 467 while (ptr < strend) 465 *(str++) = (tchar)ntohs(*(ptr++)); // convert from network order (big-endian) 468 { 469 const u16 native = to_be16(*(ptr++)); // we want from_be16, but that's the same 470 *(str++) = (tchar)native; 471 } 466 472 467 473 return (const u8 *)(strend+1); -
ps/trunk/source/ps/Util.cpp
r9550 r9572 21 21 22 22 #include "lib/posix/posix_utsname.h" 23 #include "lib/posix/posix_sock.h"24 23 #include "lib/ogl.h" 25 24 #include "lib/timer.h" … … 127 126 fprintf(f, "Sound Drivers : %ls\n", snd_drv_ver); 128 127 129 130 //131 // network name / ips132 //133 134 // note: can't use un.nodename because it is for an135 // "implementation-defined communications network".136 char hostname[128] = "(unknown)";137 (void)gethostname(hostname, sizeof(hostname)-1);138 // -1 makes sure it's 0-terminated. if the function fails,139 // we display "(unknown)" and will skip IP output below.140 fprintf(f, "Network Name : %s", hostname);141 142 {143 // ignore exception here - see https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=114032144 hostent* host = gethostbyname(hostname);145 if(!host)146 goto no_ip;147 struct in_addr** ips = (struct in_addr**)host->h_addr_list;148 if(!ips)149 goto no_ip;150 151 // output all IPs (> 1 if using VMware or dual ethernet)152 fprintf(f, " (");153 for(size_t i = 0; i < 256 && ips[i]; i++) // safety154 {155 // separate entries but avoid trailing comma156 if(i != 0)157 fprintf(f, ", ");158 fprintf(f, "%s", inet_ntoa(*ips[i]));159 }160 fprintf(f, ")");161 }162 163 no_ip:164 fprintf(f, "\n");165 166 167 128 // OpenGL extensions (write them last, since it's a lot of text) 168 129 const char* exts = ogl_ExtensionString();
Note:
See TracChangeset
for help on using the changeset viewer.
