This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 9572 for ps


Ignore:
Timestamp:
05/29/11 21:59:51 (14 years ago)
Author:
Jan Wassenberg
Message:

remove no longer necessary lowlevel wsock implementation (superseded by enet) since the delay load hook isn't compatible with a DLL packaging of enet.
-> cstr serialization uses lib/byte_order.h instead of htons; removed hostname/IP from system_info (Philip agrees its utility is negligible)

Location:
ps/trunk/source
Files:
4 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/lib/posix/posix.h

    r9369 r9572  
    7575//#include "lib/posix/posix_mman.h"
    7676//#include "lib/posix/posix_pthread.h"
    77 //#include "lib/posix/posix_sock.h"
    7877//#include "lib/posix/posix_time.h"
    7978//#include "lib/posix/posix_utsname.h"
  • ps/trunk/source/lib/sysdep/os/win/win.h

    r7316 r9572  
    3333
    3434// Win32 socket declarations aren't portable (e.g. problems with socklen_t)
    35 // => skip winsock.h; posix_sock.h should be used instead.
     35// => skip winsock.h; use curl or enet library instead.
    3636#define _WINSOCKAPI_
    3737
  • ps/trunk/source/ps/CStr.cpp

    r9410 r9572  
    2727#define CStr_CPP_FIRST
    2828
    29 #include "lib/posix/posix_sock.h" // htons, ntohs
    3029#include "lib/fnv_hash.h"
    3130#include "lib/utf8.h"
     31#include "lib/byte_order.h"
    3232#include "network/Serialization.h"
    3333#include <cassert>
     
    447447    size_t i = 0;
    448448    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    }
    450453    *(u16 *)(buffer + i*2) = 0;
    451454    return buffer + len*2 + 2;
     
    463466    std::wstring::iterator str = begin();
    464467    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    }
    466472
    467473    return (const u8 *)(strend+1);
  • ps/trunk/source/ps/Util.cpp

    r9550 r9572  
    2121
    2222#include "lib/posix/posix_utsname.h"
    23 #include "lib/posix/posix_sock.h"
    2423#include "lib/ogl.h"
    2524#include "lib/timer.h"
     
    127126    fprintf(f, "Sound Drivers  : %ls\n", snd_drv_ver);
    128127
    129 
    130     //
    131     // network name / ips
    132     //
    133 
    134     // note: can't use un.nodename because it is for an
    135     // "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=114032
    144         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++)   // safety
    154         {
    155             // separate entries but avoid trailing comma
    156             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 
    167128    // OpenGL extensions (write them last, since it's a lot of text)
    168129    const char* exts = ogl_ExtensionString();
Note: See TracChangeset for help on using the changeset viewer.