Cleanup include statements

Remove useless includes and add some preprocessor conditions for platform specific headers.
This commit is contained in:
Patrick Gansterer 2014-02-28 00:57:19 +01:00 committed by Andy Green
parent 8a59033565
commit e5720a347e
7 changed files with 12 additions and 16 deletions

View file

@ -23,7 +23,6 @@
#ifdef WIN32 #ifdef WIN32
#include <tchar.h> #include <tchar.h>
#include <io.h>
#else #else
#ifdef LWS_BUILTIN_GETIFADDRS #ifdef LWS_BUILTIN_GETIFADDRS
#include <getifaddrs.h> #include <getifaddrs.h>

View file

@ -23,7 +23,6 @@
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#include <tchar.h> #include <tchar.h>
#include <io.h>
#include <mstcpip.h> #include <mstcpip.h>
#else #else
#ifdef LWS_BUILTIN_GETIFADDRS #ifdef LWS_BUILTIN_GETIFADDRS
@ -37,7 +36,9 @@
#include <netdb.h> #include <netdb.h>
#endif #endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif
#ifdef LWS_OPENSSL_SUPPORT #ifdef LWS_OPENSSL_SUPPORT
int openssl_websocket_private_data_index; int openssl_websocket_private_data_index;

View file

@ -21,10 +21,6 @@
#include "private-libwebsockets.h" #include "private-libwebsockets.h"
#ifdef WIN32
#include <io.h>
#endif
static int static int
libwebsocket_0405_frame_mask_generate(struct libwebsocket *wsi) libwebsocket_0405_frame_mask_generate(struct libwebsocket *wsi)
{ {

View file

@ -21,11 +21,6 @@
#include "private-libwebsockets.h" #include "private-libwebsockets.h"
#if defined(WIN32) || defined(_WIN32)
#include <io.h>
#endif
unsigned char lextable[] = { unsigned char lextable[] = {
#include "lextable.h" #include "lextable.h"
}; };

View file

@ -32,6 +32,9 @@
#if _MSC_VER > 1000 || defined(_WIN32) #if _MSC_VER > 1000 || defined(_WIN32)
#else #else
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <strings.h> #include <strings.h>
#endif #endif
@ -39,9 +42,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <limits.h> #include <limits.h>
#ifdef __MINGW64__ #ifdef __MINGW64__
#else #else
@ -53,7 +53,9 @@
#endif #endif
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h> #include <sys/stat.h>
#endif
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#define LWS_NO_DAEMONIZE #define LWS_NO_DAEMONIZE
@ -79,7 +81,6 @@
#endif #endif
#endif #endif
#include <winsock2.h> #include <winsock2.h>
#include <ws2ipdef.h>
#include <windows.h> #include <windows.h>
#define LWS_INVALID_FILE INVALID_HANDLE_VALUE #define LWS_INVALID_FILE INVALID_HANDLE_VALUE
#else #else

View file

@ -24,7 +24,6 @@
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#include <tchar.h> #include <tchar.h>
#include <io.h>
#else #else
#ifdef LWS_BUILTIN_GETIFADDRS #ifdef LWS_BUILTIN_GETIFADDRS
#include <getifaddrs.h> #include <getifaddrs.h>

View file

@ -32,7 +32,12 @@
* implemented by Jun-ichiro itojun Itoh <itojun@itojun.org> * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
*/ */
#include "private-libwebsockets.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#ifndef BIG_ENDIAN #ifndef BIG_ENDIAN