Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/ivoknutsel/openscad into iv…
Browse files Browse the repository at this point in the history
…oknutsel-master
  • Loading branch information
kintel committed Aug 20, 2013
2 parents fe7fb45 + 61e6178 commit 154c65d
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 8 deletions.
7 changes: 5 additions & 2 deletions bison.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
bison.input = BISONSOURCES
bison.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp
bison.commands = bison -d -p ${QMAKE_FILE_BASE} -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp ${QMAKE_FILE_IN}
bison.commands += && if [ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
# bison.commands += && if [[ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]] ; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
bison.CONFIG += target_predeps
bison.variable_out = GENERATED_SOURCES
silent:bison.commands = @echo Bison ${QMAKE_FILE_IN} && $$bison.commands
QMAKE_EXTRA_COMPILERS += bison
bison_header.input = BISONSOURCES
bison_header.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h
bison_header.commands = bison -d -p ${QMAKE_FILE_BASE} -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.cpp ${QMAKE_FILE_IN}
bison_header.commands += && if [ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
# bison_header.commands += && if [ -e ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ]; then mv ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.hpp ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}_yacc.h ; fi
bison_header.CONFIG += target_predeps no_link
silent:bison_header.commands = @echo Bison ${QMAKE_FILE_IN} && $$bison.commands
QMAKE_EXTRA_COMPILERS += bison_header
Expand Down Expand Up @@ -40,3 +40,6 @@ netbsd* {
QMAKE_YACC = bison
}
}

win32*msvc* {
}
2 changes: 1 addition & 1 deletion cgal.pri
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cgal {
*-g++* {
QMAKE_CXXFLAGS += -frounding-math
}
LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc90-mt-s
LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc110-mt-gd
} else {
LIBS += -lgmp -lmpfr -lCGAL
QMAKE_CXXFLAGS += -frounding-math
Expand Down
1 change: 1 addition & 0 deletions src/GLView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "stdio.h"
#include "rendersettings.h"
#include "mathc99.h"

#ifdef _WIN32
#include <GL/wglew.h>
Expand Down
2 changes: 1 addition & 1 deletion src/OpenCSGRenderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ void OpenCSGRenderer::renderCSGChain(CSGChain *chain, GLint *shaderinfo,
std::vector<OpenCSG::Primitive*> primitives;
size_t j = 0;
for (size_t i = 0;; i++) {
const CSGChainObject &i_obj = chain->objects[i];
bool last = i == chain->objects.size();
const CSGChainObject &i_obj = last ? chain->objects[i-1] : chain->objects[i];
if (last || i_obj.type == CSGTerm::TYPE_UNION) {
if (j+1 != i) {
OpenCSG::render(primitives);
Expand Down
1 change: 1 addition & 0 deletions src/control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "builtin.h"
#include "printutils.h"
#include <sstream>
#include "mathc99.h"

enum control_type_e {
CHILD,
Expand Down
4 changes: 3 additions & 1 deletion src/import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const
#ifdef BOOST_BIG_ENDIAN
uint32_byte_swap( facenum );
#endif
if (file_size == 80 + 4 + 50*facenum) binary = true;
if (file_size == static_cast<std::streamoff>(80 + 4 + 50*facenum)) {
binary = true;
}
}
f.seekg(0);

Expand Down
2 changes: 1 addition & 1 deletion src/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "handle_dep.h"
#include "printutils.h"
#include "parsersettings.h"
#include "parser_yacc.h"
#include "parser_yacc.hpp"
#include "module.h"
#include <assert.h>
#include <boost/foreach.hpp>
Expand Down
6 changes: 5 additions & 1 deletion src/mathc99.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
#ifdef WIN32
#include <algorithm>

double trunc(double a) {
return (a >= 0) ? floor(a) : ceil(a);
}

double round(double a) {
return a > 0 ? floor(a+0.5) : ceil(a-0.5);
return a < 0 ? ceil(a - 0.5f) : floor(a + 0.5f);
}

float fmin(float a, float b) {
Expand Down
1 change: 1 addition & 0 deletions src/mathc99.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <cmath>
//for native win32 builds we need to provide C99 math functions by ourselves
double trunc(double a);
double round(double a);
float fmin(float a, float b);
float fmax(float a, float b);
Expand Down
7 changes: 6 additions & 1 deletion win.pri
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ win32*msvc* {
INCLUDEPATH += $$(MPIRDIR)
INCLUDEPATH += $$(MPFRDIR)

DEFINES += _USE_MATH_DEFINES NOMINMAX _CRT_SECURE_NO_WARNINGS YY_NO_UNISTD_H
# don't know where the __WIN32__ is usually set
DEFINES += _USE_MATH_DEFINES NOMINMAX _CRT_SECURE_NO_WARNINGS YY_NO_UNISTD_H __WIN32__

# disable MSVC warnings that are of very low importance
# disable warning about too long decorated names
Expand All @@ -16,5 +17,9 @@ win32*msvc* {
QMAKE_CXXFLAGS += -wd4100
# lexer uses strdup() & other POSIX stuff
QMAKE_CXXFLAGS += -D_CRT_NONSTDC_NO_DEPRECATE
# Treat WChar_t as a builtin type, allows Qt to call boost funcions
QMAKE_CXXFLAGS += /Zc:wchar_t
# increases the number of sections in .obj file
QMAKE_CXXFLAGS += /bigobj

}

0 comments on commit 154c65d

Please sign in to comment.