Build fixes to compile on MXE with C++11 enabled.

master
Torsten Paul 2015-03-22 14:17:12 +01:00
parent d37f4fbbab
commit c71e70c0f9
7 changed files with 15 additions and 14 deletions

View File

@ -216,7 +216,7 @@ void GLView::enable_opencsg_shaders()
else if (GLEW_EXT_framebuffer_object && GLEW_EXT_packed_depth_stencil) {
this->is_opencsg_capable = true;
}
#ifdef WIN32
#ifdef _WIN32
else if (WGLEW_ARB_pbuffer && WGLEW_ARB_pixel_format) this->is_opencsg_capable = true;
#elif !defined(__APPLE__)
else if (GLXEW_SGIX_pbuffer && GLXEW_SGIX_fbconfig) this->is_opencsg_capable = true;

View File

@ -33,7 +33,7 @@ static std::string lookupResourcesPath()
NULL
};
#else
#ifdef WIN32
#ifdef _WIN32
const char *searchpath[] = {
".", // Release location
RESOURCE_FOLDER("../share/openscad"), // MSYS2 location
@ -185,7 +185,7 @@ fs::path PlatformUtils::resourcePath(const std::string &resource)
int PlatformUtils::setenv(const char *name, const char *value, int overwrite)
{
#if defined(WIN32)
#if defined(_WIN32)
const char *ptr = getenv(name);
if ((overwrite == 0) && (ptr != NULL)) {
return 0;

View File

@ -135,14 +135,11 @@ void QGLView::display_opencsg_warning_dialog()
message += _("It is highly recommended to use OpenSCAD on a system with "
"OpenGL 2.0 or later.\n"
"Your renderer information is as follows:\n");
QString rendererinfo;
rendererinfo.sprintf(_("GLEW version %s\n"
"%s (%s)\n"
"OpenGL version %s\n"),
glewGetString(GLEW_VERSION),
glGetString(GL_RENDERER), glGetString(GL_VENDOR),
glGetString(GL_VERSION));
message += rendererinfo;
QString rendererinfo(_("GLEW version %1\n%2 (%3)\nOpenGL version %4\n"));
message += rendererinfo.arg((const char *)glewGetString(GLEW_VERSION),
(const char *)glGetString(GL_RENDERER),
(const char *)glGetString(GL_VENDOR),
(const char *)glGetString(GL_VERSION));
dialog->setText(message);
dialog->enableOpenCSGBox->setChecked(Preferences::inst()->getValue("advanced/enable_opencsg_opengl1x").toBool());

View File

@ -24,13 +24,13 @@
*
*/
#include "mathc99.h"
#include "function.h"
#include "expression.h"
#include "evalcontext.h"
#include "builtin.h"
#include <sstream>
#include <ctime>
#include "mathc99.h"
#include <limits>
#include <algorithm>
#include "stl-utils.h"

View File

@ -3,7 +3,7 @@
#include "mathc99.h"
#include "linalg.h"
#ifdef WIN32
#ifdef _WIN32
typedef __int64 int64_t;
#else
#include <stdint.h>

View File

@ -1,6 +1,8 @@
#pragma once
#ifdef WIN32
#if defined(_MSC_VER)
// only for native windows builds, not MXE
#include <cmath>
//for native win32 builds we need to provide C99 math functions by ourselves
@ -11,6 +13,7 @@ float fmax(float a, float b);
#else
#define _USE_MATH_DEFINES
#include <math.h>
#endif

View File

@ -1,3 +1,4 @@
#include "mathc99.h"
#include "modcontext.h"
#include "module.h"
#include "expression.h"