mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 18:38:24 +02:00
get rid of arpa/inet.h and netdb.h
This commit is contained in:
parent
9bc4a3df41
commit
5725a92cfe
6 changed files with 227 additions and 225 deletions
|
@ -6,7 +6,7 @@
|
|||
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <arpa/inet.h>
|
||||
//#include <arpa/inet.h> // not available on windows, apparently not needed on mac
|
||||
#include <signal.h>
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <arpa/inet.h>
|
||||
//#include <arpa/inet.h> // not available on windows, apparently not needed on mac
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <netdb.h>
|
||||
//#include <netdb.h> // not available on windows, apparently not needed on mac
|
||||
|
||||
#include <QtNetwork/QHostInfo>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#define __shared_NetworkPacket__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <arpa/inet.h>
|
||||
//#include <arpa/inet.h> // not available on windows, apparently not needed on mac
|
||||
#include <ifaddrs.h>
|
||||
|
||||
#include "HifiSockAddr.h"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#ifdef _WIN32
|
||||
#include "Syssocket.h"
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
//#include <arpa/inet.h> // not available on windows, apparently not needed on mac
|
||||
#endif
|
||||
|
||||
#include "Node.h"
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
//#include <arpa/inet.h> // not available on windows, apparently not needed on mac
|
||||
|
||||
const int INET_ADDR_STRLEN = 16;
|
||||
|
||||
#include <QtNetwork/QUdpSocket>
|
||||
|
||||
|
@ -28,7 +30,7 @@ struct PairableDevice {
|
|||
};
|
||||
|
||||
struct RequestingClient {
|
||||
char address[INET_ADDRSTRLEN];
|
||||
char address[INET_ADDR_STRLEN];
|
||||
int port;
|
||||
};
|
||||
|
||||
|
@ -47,7 +49,7 @@ int indexOfFirstOccurenceOfCharacter(char* haystack, char needle) {
|
|||
}
|
||||
|
||||
void sendLastClientToLastDevice() {
|
||||
char pairData[INET_ADDRSTRLEN + 6] = {};
|
||||
char pairData[INET_ADDR_STRLEN + 6] = {};
|
||||
int bytesWritten = sprintf(pairData, "%s:%d", ::lastClient->address, ::lastClient->port);
|
||||
|
||||
::serverSocket.writeDatagram(pairData, bytesWritten,
|
||||
|
@ -70,7 +72,7 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
PairableDevice tempDevice = {};
|
||||
|
||||
char deviceAddress[INET_ADDRSTRLEN] = {};
|
||||
char deviceAddress[INET_ADDR_STRLEN] = {};
|
||||
int socketPort = 0;
|
||||
|
||||
int numMatches = sscanf(senderData, "Available %s %[^:]:%d %s",
|
||||
|
|
Loading…
Reference in a new issue