Trac 53 minw update

http://libwebsockets.org/trac/libwebsockets/ticket/53
This commit is contained in:
pmcdona 2013-12-18 10:17:25 +08:00 committed by Andy Green
parent 7a1327977a
commit 0a0a7ebc37
4 changed files with 38 additions and 2 deletions

View file

@ -310,7 +310,11 @@ endif(UNIX)
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
if (UNIX)
set( CMAKE_C_FLAGS "-Wall -Werror -O4 -fvisibility=hidden ${CMAKE_C_FLAGS}" )
else(UNIX)
set( CMAKE_C_FLAGS "-Wall -O4 -fvisibility=hidden ${CMAKE_C_FLAGS}" )
endif(UNIX)
endif ()
source_group("Headers Private" FILES ${HDR_PRIVATE})

31
cross-ming.cmake Normal file
View file

@ -0,0 +1,31 @@
#
# CMake Toolchain file for crosscompiling on MingW.
#
# This can be used when running cmake in the following way:
# cd build/
# cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-ming.cmake
#
set(CROSS_PATH /usr/bin)
# Target operating system name.
set(CMAKE_SYSTEM_NAME Windows)
set(BUILD_SHARED_LIBS OFF)
# Name of C compiler.
set(CMAKE_C_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-gcc")
#set(CMAKE_CXX_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-windres")
set(CMAKE_C_FLAGS "-Wno-error")
# Where to look for the target environment. (More paths can be added here)
set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
# Adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment only.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search headers and libraries in the target environment only.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View file

@ -35,7 +35,7 @@ extern "C" {
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stddef.h>
#include <BaseTsd.h>
#include <basetsd.h>
#include "websock-w32.h"
#include "gettimeofday.h"

View file

@ -10,6 +10,7 @@
#include <stdio.h>
#include "zutil.h"
#include "gzguts.h"
#ifdef NO_DEFLATE /* for compatiblity with old definition */
# define NO_GZCOMPRESS
@ -977,7 +978,7 @@ const char * ZEXPORT gzerror (file, errnum)
*errnum = s->z_err;
if (*errnum == Z_OK) return (const char*)"";
m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
m = (char*)(*errnum == Z_ERRNO ? zstrerror() : s->stream.msg);
if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);