conditionally include winsock2.h instead of UNIX socket stuff

This commit is contained in:
Stephen Birarda 2013-03-19 11:46:53 -07:00
parent 8ef885aaaf
commit c7213d6593
11 changed files with 67 additions and 35 deletions

View file

@ -22,19 +22,21 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#ifdef _WIN32
#include "Systime.h"
#else
#include <sys/time.h>
#endif _WIN32
#include <map>
#include "AgentList.h"
#include "SharedUtil.h"
#ifdef _WIN32
#include "Systime.h"
#include <winsock2.h>
#else
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif _WIN32
const int DOMAIN_LISTEN_PORT = 40102;
unsigned char packetData[MAX_PACKET_SIZE];

View file

@ -15,14 +15,10 @@
//
#include "SerialInterface.h"
#include <dirent.h>
#ifdef _WIN32
#include "Systime.h"
#else
#include <sys/time.h>
#endif
#ifdef __APPLE__
#include <regex.h>
#include <sys/time.h>
#endif
int serial_fd;
@ -224,6 +220,7 @@ void SerialInterface::readData() {
}
void SerialInterface::resetSerial() {
#ifdef __APPLE__
active = false;
totalSamples = 0;
@ -238,6 +235,7 @@ void SerialInterface::resetSerial() {
for (int i = 1; i < MAX_BUFFER; i++) {
serial_buffer[i] = ' ';
}
#endif
}

View file

@ -17,6 +17,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <dirent.h>
#endif
#define NUM_CHANNELS 6

View file

@ -25,14 +25,16 @@
#ifdef _WIN32
#include "Systime.h"
#include <winsock2.h>
#else
#include <sys/time.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#endif
#include <pthread.h>
#include <ifaddrs.h>
#include <glm/glm.hpp>
#include <arpa/inet.h>
#include "Field.h"
#include "world.h"
#include "Util.h"

View file

@ -3,15 +3,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#ifdef _WIN32
#include "Systime.h"
#else
#include <sys/time.h>
#endif _WIN32
#include <pthread.h>
#include <errno.h>
#include <fstream>
@ -21,6 +13,16 @@
#include <StdDev.h>
#include "AudioRingBuffer.h"
#ifdef _WIN32
#include "Systime.h"
#include <winsock2.h>
#else
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif _WIN32
const unsigned short MIXER_LISTEN_PORT = 55443;
const float SAMPLE_RATE = 22050.0;

View file

@ -7,11 +7,16 @@
//
#include "Agent.h"
#include <arpa/inet.h>
#include <cstring>
#include "UDPSocket.h"
#include "SharedUtil.h"
#ifdef _WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
Agent::Agent() {}
Agent::Agent(sockaddr *agentPublicSocket, sockaddr *agentLocalSocket, char agentType) {

View file

@ -11,7 +11,12 @@
#include <iostream>
#include "AgentData.h"
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
class Agent {
public:

View file

@ -7,10 +7,15 @@
//
#include "AgentList.h"
#include <arpa/inet.h>
#include <pthread.h>
#include "SharedUtil.h"
#ifdef _WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
const char * SOLO_AGENT_TYPES_STRING = "MV";
bool stopAgentRemovalThread = false;

View file

@ -7,13 +7,18 @@
//
#include "UDPSocket.h"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <cstdio>
#include <errno.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#endif
sockaddr_in destSockaddr, senderAddress;
bool socketMatch(sockaddr *first, sockaddr *second) {

View file

@ -10,8 +10,13 @@
#define __interface__UDPSocket__
#include <iostream>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <netinet/in.h>
#include <netdb.h>
#endif
#define MAX_BUFFER_LENGTH_BYTES 1500

View file

@ -6,14 +6,7 @@
// Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
//
#ifdef _WIN32
#include "Systime.h"
#else
#include <sys/time.h>
#endif _WIN32
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
@ -23,6 +16,15 @@
#include <AgentList.h>
#include <VoxelTree.h>
#ifdef _WIN32
#include "Systime.h"
#include <winsock2.h>
#else
#include <sys/time.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#endif _WIN32
const int VOXEL_LISTEN_PORT = 40106;
const int NUMBER_OF_VOXELS = 250000;