Fixes for compatibility with FreeBSD

backtrace.cpp assumes that anything non-windows is linux.

stb_vorbis.c includes malloc.h which has been deprecated since the 90s
on all implementations other than MSVC.

The stat64 hack in file_util.cpp is only needed on linux.

http_client.h also assumes non-windows is linux.
This commit is contained in:
Kovensky 2012-11-18 21:36:07 -03:00
parent d0328191ef
commit b17119f2c6
4 changed files with 14 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#include "base/backtrace.h"
#ifndef _MSC_VER
#ifdef __linux__
// LINUX ONLY

View File

@ -205,7 +205,7 @@
#include <string.h>
#include <assert.h>
#include <math.h>
#if !(defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh))
#ifdef _MSC_VER
#include <malloc.h>
#endif
#else

View File

@ -17,6 +17,10 @@
#include "base/basictypes.h"
#include "file/file_util.h"
#ifdef __FreeBSD__
#define stat64 stat
#endif
bool writeStringToFile(bool text_file, const std::string &str, const char *filename)
{
FILE *f = fopen(filename, text_file ? "w" : "wb");

View File

@ -4,11 +4,15 @@
#include "base/basictypes.h"
#include "base/buffer.h"
#ifndef _WIN32
#include <arpa/inet.h>
#include <sys/socket.h>
#else
#ifdef _WIN32
#include <winsock2.h>
#else
#ifdef __FreeBSD__
#include <netinet/in.h>
#else
#include <arpa/inet.h>
#endif
#include <sys/socket.h>
#endif
namespace net {