Commit 365e527e authored by Alfons Laarman's avatar Alfons Laarman Committed by Michael Weber
Browse files

cygwin patch

parent 8ca044a0
......@@ -8,7 +8,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#if defined (__linux)
#if defined (__linux) || defined(__CYGWIN__)
#include <sys/resource.h>
#endif
#ifdef __APPLE__
......
......@@ -37,7 +37,7 @@ add_definitions( ${OPT_FLAGS} )
add_library( wibble STATIC ${WSRC} )
if( WIN32 )
target_link_libraries( wibble wsock32 psapi regex )
target_link_libraries( wibble wsock32 psapi )
else( WIN32 )
target_link_libraries( wibble pthread )
endif( WIN32 )
......
......@@ -5,7 +5,7 @@
#include <cstdlib>
#include <set>
#include <cstdio>
#ifdef _WIN32
#if defined(_WIN32) || defined(__CYGWIN__)
#include <ctime>
#endif
......
......@@ -30,8 +30,10 @@
#include <iostream>
#ifdef POSIX
#ifndef __CYGWIN__
#include <execinfo.h>
#endif
#endif
using namespace std;
......@@ -46,9 +48,14 @@ void DefaultUnexpected()
try {
const int trace_size = 50;
void *addrs[trace_size];
#ifndef __CYGWIN__
size_t size = backtrace (addrs, trace_size);
char **strings = backtrace_symbols (addrs, size);
#else
size_t size = 0;
char **strings = (char**)&"";
#endif
cerr << "Caught unexpected exception, " << size << " stack frames unwound:" << endl;
for (size_t i = 0; i < size; i++)
cerr << " " << strings[i] << endl;
......
......@@ -39,6 +39,14 @@ struct timespec
#endif
#include <errno.h>
#ifdef __CYGWIN__
#define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
#define PTHREAD_MUTEX_TIMED_NP PTHREAD_MUTEX_NORMAL
#define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_NORMAL
#endif /* __CYGWIN__ */
namespace wibble {
namespace sys {
......
......@@ -27,6 +27,12 @@
#ifdef POSIX
#include <sys/types.h>
#ifdef __CYGWIN__
#define RLIMIT_RSS 8
#define RLIMIT_NPROC 9
#define RLIMIT_MEMLOCK 10
#endif
namespace wibble {
namespace sys {
namespace process {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment