Use proper Ruby 1.8 header path

This commit is contained in:
Inori 2019-08-01 14:55:45 -04:00 committed by Inori
parent ce4fdf3104
commit 18bd8084ec
4 changed files with 9 additions and 12 deletions

View file

@ -31,11 +31,10 @@
#include "audio.h" #include "audio.h"
#include "boost-hash.h" #include "boost-hash.h"
#ifndef OLD_RUBY
#include <ruby.h> #include <ruby.h>
#ifndef OLD_RUBY
#include <ruby/encoding.h> #include <ruby/encoding.h>
#else
#include <ruby/ruby.h>
#endif #endif
#include <assert.h> #include <assert.h>

View file

@ -22,11 +22,7 @@
#ifndef BINDING_UTIL_H #ifndef BINDING_UTIL_H
#define BINDING_UTIL_H #define BINDING_UTIL_H
#ifndef OLD_RUBY
#include <ruby.h> #include <ruby.h>
#else
#include <ruby/ruby.h>
#endif
#include "exception.h" #include "exception.h"
@ -69,7 +65,7 @@ raiseRbExc(const Exception &exc);
#ifndef OLD_RUBY #ifndef OLD_RUBY
#define DECL_TYPE(Klass) \ #define DECL_TYPE(Klass) \
extern rb_data_type_t Klass##Type extern rb_data_type_t Klass##Type
#endif
/* 2.1 has added a new field (flags) to rb_data_type_t */ /* 2.1 has added a new field (flags) to rb_data_type_t */
#include <ruby/version.h> #include <ruby/version.h>
@ -79,6 +75,7 @@ raiseRbExc(const Exception &exc);
#else #else
#define DEF_TYPE_FLAGS #define DEF_TYPE_FLAGS
#endif #endif
#endif
#ifndef OLD_RUBY #ifndef OLD_RUBY
#define DEF_TYPE_CUSTOMNAME_AND_FREE(Klass, Name, Free) \ #define DEF_TYPE_CUSTOMNAME_AND_FREE(Klass, Name, Free) \
@ -130,8 +127,7 @@ raiseRbExc(const Exception &exc);
#define DEF_ALLOCFUNC_CUSTOMFREE(type,free) \ #define DEF_ALLOCFUNC_CUSTOMFREE(type,free) \
static VALUE type##Allocate(VALUE klass)\ static VALUE type##Allocate(VALUE klass)\
{ \ { \
void *sval = 0; \ return Data_Wrap_Struct(klass, 0, free, 0); \
return Data_Wrap_Struct(klass, 0, free, sval); \
} }
#define DEF_ALLOCFUNC(type) DEF_ALLOCFUNC_CUSTOMFREE(type, freeInstance<type>) #define DEF_ALLOCFUNC(type) DEF_ALLOCFUNC_CUSTOMFREE(type, freeInstance<type>)

View file

@ -27,8 +27,10 @@
#ifndef OLD_RUBY #ifndef OLD_RUBY
#include "ruby/encoding.h" #include "ruby/encoding.h"
#endif
#include "ruby/intern.h" #include "ruby/intern.h"
#else
#include "intern.h"
#endif
static void static void
fileIntFreeInstance(void *inst) fileIntFreeInstance(void *inst)

View file

@ -1,7 +1,7 @@
// Most of the MiniDL class was taken from Ruby 1.8's Win32API.c, // Most of the MiniDL class was taken from Ruby 1.8's Win32API.c,
// it's just as basic but should work fine for the moment // it's just as basic but should work fine for the moment
#include <ruby/ruby.h> #include <ruby.h>
#include <SDL.h> #include <SDL.h>
#if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES) #if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES)
#include <SDL_syswm.h> #include <SDL_syswm.h>