* Enabled c++11 support (required for IO::AMF), extended Travis build to build with g++ 4.9
* ifdef guard in poly2tri/util to avoid redefinition warning
* cache local-lib
This commit is contained in:
Joseph Lenox 2017-03-02 00:46:20 -06:00 committed by GitHub
parent 46ea9c5066
commit 3c4f93cf24
3 changed files with 15 additions and 3 deletions

View File

@ -11,13 +11,18 @@ branches:
- stable
sudo: false
cache:
- apt
apt: true
directories:
- local-lib
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
packages:
- libboost-thread1.55-dev
- libboost-system1.55-dev
- libboost-filesystem1.55-dev
- liblocal-lib-perl
- g++-4.9
env: CC=g++-4.9

View File

@ -15,8 +15,13 @@ my $mswin = $^O eq 'MSWin32';
# HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
# std=c++11 Enforce usage of C++11 (required now). Minimum compiler supported: gcc 4.9, clang 3.3, MSVC 14.0
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE
-Wno-c++11-extensions);
-std=c++11);
if ($cpp_guess->is_gcc) {
# GCC is pedantic with c++11 std, so undefine strict ansi to get M_PI back
push @cflags, qw(-U__STRICT_ANSI__);
}
my @ldflags = ();
if ($^O eq 'darwin') {
push @ldflags, qw(-framework IOKit -framework CoreFoundation);

View File

@ -33,7 +33,9 @@
#define UTILS_H
// Otherwise #defines like M_PI are undeclared under Visual Studio
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <exception>
#include <math.h>
@ -119,4 +121,4 @@ bool InScanArea(const Point& pa, const Point& pb, const Point& pc, const Point&
}
#endif
#endif