Skip to content

Commit

Permalink
hacky hotfixes to c++11 support breaking windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
fishuyo committed Oct 28, 2015
1 parent 3cafd23 commit eb08e11
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 14 deletions.
12 changes: 6 additions & 6 deletions allocore/allocore/math/al_Functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
#endif

// Define some standard C99 functions that Windows is too stubborn to support.
#if defined(AL_WINDOWS)
#define nextafterf(x,y) _nextafterf(x,y)
//float nextafterf(float x, float y);
#define nextafter(x,y) _nextafter(x,y)
#define nextafterl(x,y) _nextafter(x,y)
#endif
// #if defined(AL_WINDOWS)
// #define nextafterf(x,y) _nextafterf(x,y)
// //float nextafterf(float x, float y);
// #define nextafter(x,y) _nextafter(x,y)
// #define nextafterl(x,y) _nextafter(x,y)
// #endif


namespace al {
Expand Down
2 changes: 1 addition & 1 deletion allocore/allocore/system/al_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

#define AL_SYSTEM_LIB_VERSION 0.01

#if defined(WIN32) || defined(__WINDOWS_MM__) || defined(WIN64)
#if defined(WIN32) || defined(__WINDOWS_MM__) || defined(WIN64) || defined(AL_WINDOWS)
#define AL_WINDOWS 1

// Experimentally not include all of windows.h .
Expand Down
4 changes: 3 additions & 1 deletion allocore/src/graphics/al_Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
#include FT_OUTLINE_H
#include FT_GLYPH_H

#elif defined WIN32
#elif defined (WIN32) || defined(AL_WINDOWS)

#include <windows.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_GLYPH_H

#else
#error "do not know this operating system"
#endif

extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion allocore/src/io/al_FileAPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// for these two tasks...

#include "../private/al_ImplAPR.h"
#ifdef AL_LINUX
#if defined(AL_LINUX) && !defined(AL_WINDOWS)
#include "apr-1.0/apr_file_io.h"
#include "apr-1.0/apr_file_info.h"
#else
Expand Down
2 changes: 1 addition & 1 deletion allocore/src/io/al_SocketAPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can actually use connect() on UDP socket as an option. In that case, you can
#include "allocore/system/al_Printing.hpp"

#include "../private/al_ImplAPR.h"
#ifdef AL_LINUX
#if defined(AL_LINUX) && !defined(AL_WINDOWS)
#include "apr-1.0/apr_network_io.h"
#else
#include "apr-1/apr_network_io.h"
Expand Down
2 changes: 1 addition & 1 deletion allocore/src/private/al_ImplAPR.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// need this to pick up AL_LINUX etc:
#include "allocore/system/al_Config.h"

#ifdef AL_LINUX
#if defined(AL_LINUX) && !defined(AL_WINDOWS)
#include "apr-1.0/apr_general.h"
#include "apr-1.0/apr_errno.h"
#include "apr-1.0/apr_pools.h"
Expand Down
2 changes: 1 addition & 1 deletion allocore/src/protocol/al_XML.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "allocore/protocol/al_XML.hpp"
#include "../private/al_ImplAPR.h"

#ifdef AL_LINUX
#if defined(AL_LINUX) && !defined(AL_WINDOWS)
#include "apr-1.0/apr_general.h"
#include "apr-1.0/apr_xml.h"
#include "apr-1.0/apr_file_io.h"
Expand Down
1 change: 1 addition & 0 deletions allocore/src/sound/al_Biquad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//
#include "allocore/sound/al_Biquad.hpp"
#include "allocore/math/al_Constants.hpp"
#include <stdlib.h>
#include <cmath>

Expand Down
3 changes: 2 additions & 1 deletion allocore/src/system/al_ThreadNative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ struct Thread::Impl{
unsigned long mHandle;
// ThreadFunction mRoutine;

static unsigned _stdcall cThreadFunc(void * user){
static unsigned cThreadFunc(void * user){
// static unsigned _stdcall cThreadFunc(void * user){
ThreadFunction& tfunc = *((ThreadFunction*)user);
tfunc();
return 0;
Expand Down
3 changes: 2 additions & 1 deletion allocore/src/system/al_Time.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "allocore/system/al_Time.hpp"
#include "allocore/math/al_Constants.hpp"

#define al_nsec2sec(ns) (((al_sec)(ns)) * al_time_ns2s)
#define al_sec2nsec(s) ((al_nsec)(s * al_time_s2ns))

#define AL_TIME_USE_APR 1
#ifdef AL_TIME_USE_APR

#ifdef AL_LINUX
#if defined(AL_LINUX) && !defined(AL_WINDOWS)
#include "apr-1.0/apr_time.h"
#else
#include "apr-1/apr_time.h"
Expand Down

3 comments on commit eb08e11

@LancePutnam
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these hacks should be spread out across all the source files. The problem needs to be fixed once in al_Config.h. What compiler are you using?

@mantaraya36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a change that might fix this in a better way. Can you confirm it works on Windows, @fishuyo ?

@fishuyo
Copy link
Contributor Author

@fishuyo fishuyo commented on eb08e11 Nov 2, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.