Windows compatibility

This commit is contained in:
Karroffel
2017-03-15 23:19:58 +01:00
parent bce9ac109d
commit 8d63048c6d
35 changed files with 259 additions and 43 deletions

View File

@@ -1,6 +1,16 @@
#ifndef ARRAY_H
#define ARRAY_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_array.h>
#include "String.hpp"
@@ -18,7 +28,7 @@ class PoolColorArray;
class Object;
class Array {
class GD_CPP_CORE_API Array {
godot_array _godot_array;
public:
Array();

View File

@@ -1,6 +1,16 @@
#ifndef BASIS_H
#define BASIS_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Defs.hpp"
#include "Vector3.hpp"
@@ -9,7 +19,7 @@ namespace godot {
class Quat;
class Basis {
class GD_CPP_CORE_API Basis {
public:
Vector3 elements[3];

View File

@@ -1,6 +1,16 @@
#ifndef COLOR_H
#define COLOR_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_color.h>
#include <cmath>
@@ -10,7 +20,7 @@
namespace godot {
struct Color {
struct GD_CPP_CORE_API Color {
private:

View File

@@ -18,7 +18,7 @@
#include "RID.hpp"
#include "String.hpp"
#include "Transform.hpp"
#include "Transform2D.hp"
#include "Transform2D.hpp"
#include "Variant.hpp"
#include "Vector2.hpp"
#include "Vector3.hpp"

View File

@@ -1,6 +1,16 @@
#ifndef DICTIONARY_H
#define DICTIONARY_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Variant.hpp"
#include "Array.hpp"
@@ -9,7 +19,7 @@
namespace godot {
class Dictionary {
class GD_CPP_CORE_API Dictionary {
godot_dictionary _godot_dictionary;
public:
Dictionary();

View File

@@ -1,6 +1,16 @@
#ifndef IMAGE_H
#define IMAGE_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Defs.hpp"
#include "Vector2.hpp"
@@ -14,7 +24,7 @@ namespace godot {
class PoolByteArray;
class Image {
class GD_CPP_CORE_API Image {
godot_image _godot_image;
public:

View File

@@ -4,7 +4,7 @@
#include <memory.h>
#include "Vector2.hpp"
#include "Transform2D.hp"
#include "Transform2D.hpp"
#include <cmath>

View File

@@ -1,6 +1,16 @@
#ifndef INPUTEVENT_H
#define INPUTEVENT_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <cstdint>
#include <memory.h>
@@ -119,7 +129,7 @@ enum {
* Input Modifier Status
* for keyboard/mouse events.
*/
struct InputModifierState {
struct GD_CPP_CORE_API InputModifierState {
bool shift;
bool alt;
@@ -223,7 +233,7 @@ struct InputEventAction {
class Transform2D;
struct InputEvent {
struct GD_CPP_CORE_API InputEvent {
enum Type {
NONE,

View File

@@ -1,6 +1,16 @@
#ifndef NODEPATH_H
#define NODEPATH_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "String.hpp"
#include <godot/godot_node_path.h>
@@ -8,7 +18,7 @@
namespace godot {
class NodePath
class GD_CPP_CORE_API NodePath
{
godot_node_path _node_path;
public:

View File

@@ -1,6 +1,16 @@
#ifndef PLANE_H
#define PLANE_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Vector3.hpp"
#include <cmath>
@@ -15,7 +25,7 @@ enum ClockDirection {
COUNTERCLOCKWISE
};
class Plane {
class GD_CPP_CORE_API Plane {
public:
Vector3 normal;
real_t d;

View File

@@ -1,6 +1,16 @@
#ifndef POOLARRAYS_H
#define POOLARRAYS_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Defs.hpp"
#include "String.hpp"
@@ -14,7 +24,7 @@ namespace godot {
class Array;
class PoolByteArray {
class GD_CPP_CORE_API PoolByteArray {
godot_pool_byte_array _godot_array;
public:
PoolByteArray();
@@ -45,7 +55,7 @@ public:
};
class PoolIntArray {
class GD_CPP_CORE_API PoolIntArray {
godot_pool_int_array _godot_array;
public:
PoolIntArray();
@@ -76,7 +86,7 @@ public:
};
class PoolRealArray {
class GD_CPP_CORE_API PoolRealArray {
godot_pool_real_array _godot_array;
public:
PoolRealArray();
@@ -107,7 +117,7 @@ public:
};
class PoolStringArray {
class GD_CPP_CORE_API PoolStringArray {
godot_pool_string_array _godot_array;
public:
PoolStringArray();
@@ -139,7 +149,7 @@ public:
class PoolVector2Array {
class GD_CPP_CORE_API PoolVector2Array {
godot_pool_vector2_array _godot_array;
public:
PoolVector2Array();
@@ -170,7 +180,7 @@ public:
};
class PoolVector3Array {
class GD_CPP_CORE_API PoolVector3Array {
godot_pool_vector3_array _godot_array;
public:
PoolVector3Array();
@@ -201,7 +211,7 @@ public:
};
class PoolColorArray {
class GD_CPP_CORE_API PoolColorArray {
godot_pool_color_array _godot_array;
public:
PoolColorArray();

View File

@@ -1,6 +1,16 @@
#ifndef QUAT_H
#define QUAT_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <cmath>
#include "Vector3.hpp"
@@ -9,7 +19,7 @@
namespace godot {
class Quat{
class GD_CPP_CORE_API Quat{
public:
real_t x,y,z,w;

View File

@@ -1,13 +1,23 @@
#ifndef RID_H
#define RID_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_rid.h>
namespace godot {
class Object;
class RID {
class GD_CPP_CORE_API RID {
godot_rid _godot_rid;
public:

View File

@@ -6,7 +6,7 @@
#include <cmath>
#include "Transform2D.hp"
#include "Transform2D.hpp"
namespace godot {

View File

@@ -1,6 +1,16 @@
#ifndef RECT2_H
#define RECT2_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Vector2.hpp"
#include <cmath>
@@ -16,7 +26,7 @@ typedef Vector2 Point2;
class Transform2D;
struct Rect2 {
struct GD_CPP_CORE_API Rect2 {
Point2 pos;
Size2 size;

View File

@@ -1,6 +1,16 @@
#ifndef RECT3_H
#define RECT3_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Vector3.hpp"
#include "Plane.hpp"
@@ -9,7 +19,7 @@
namespace godot {
class Rect3 {
class GD_CPP_CORE_API Rect3 {
public:
Vector3 pos;
Vector3 size;

View File

@@ -120,6 +120,11 @@ const wchar_t *String::c_string() const
}
String operator +(const char *a, const String& b)
{
return String(a) + b;
}
}

View File

@@ -1,11 +1,21 @@
#ifndef STRING_H
#define STRING_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_string.h>
namespace godot {
class String
class GD_CPP_CORE_API String
{
godot_string _godot_string;
public:

View File

@@ -1,6 +1,16 @@
#ifndef TRANSFORM_H
#define TRANSFORM_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Basis.hpp"
#include "Plane.hpp"
@@ -8,7 +18,7 @@
namespace godot {
class Transform {
class GD_CPP_CORE_API Transform {
public:
Basis basis;

View File

@@ -1,4 +1,4 @@
#include "Transform2D.hp"
#include "Transform2D.hpp"
#include "Vector2.hpp"

View File

@@ -1,6 +1,16 @@
#ifndef TRANSFORM2D_H
#define TRANSFORM2D_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Vector2.hpp"
@@ -10,7 +20,7 @@ typedef Vector2 Size2;
class Rect2;
struct Transform2D {
struct GD_CPP_CORE_API Transform2D {
// Warning #1: basis of Transform2D is stored differently from Basis. In terms of elements array, the basis matrix looks like "on paper":
// M = (elements[0][0] elements[1][0])
// (elements[0][1] elements[1][1])

View File

@@ -1,6 +1,16 @@
#ifndef VARIANT_H
#define VARIANT_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_variant.h>
#include "Defs.hpp"
@@ -18,7 +28,7 @@
#include "RID.hpp"
#include "String.hpp"
#include "Transform.hpp"
#include "Transform2D.hp"
#include "Transform2D.hpp"
#include "Vector2.hpp"
#include "Vector3.hpp"
@@ -30,7 +40,7 @@ class Dictionary;
class Array;
class Variant {
class GD_CPP_CORE_API Variant {
godot_variant _godot_variant;
public:
enum Type {

View File

@@ -2,6 +2,16 @@
#define VECTOR2_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include <godot/godot_vector2.h>
#include "Defs.hpp"
@@ -10,7 +20,7 @@ namespace godot {
class String;
struct Vector2 {
struct GD_CPP_CORE_API Vector2 {
union {
real_t x;

View File

@@ -1,6 +1,16 @@
#ifndef VECTOR3_H
#define VECTOR3_H
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
#include "Defs.hpp"
#include "String.hpp"
@@ -8,7 +18,7 @@
namespace godot {
struct Vector3 {
struct GD_CPP_CORE_API Vector3 {
enum Axis {
AXIS_X,