From 4a0a90e511bcae3e84a64e829c8b2bc7e386951a Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sun, 13 Nov 2016 16:51:27 +0100 Subject: [PATCH] Include int.h to fix windows build --HG-- branch : dynamiccore2 --- src/common/runtime.h | 4 +++- src/common/types.cpp | 14 +++++++------- src/common/types.h | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/common/runtime.h b/src/common/runtime.h index 308672b38..fcdda6b95 100644 --- a/src/common/runtime.h +++ b/src/common/runtime.h @@ -524,7 +524,9 @@ T *luax_totype(lua_State *L, int idx, love::Type& /*type*/) return o; } -uint32_t luax_type(lua_State *L, int idx); + + +uint32 luax_type(lua_State *L, int idx); /** * Converts any exceptions thrown by the passed lambda function into a Lua error. diff --git a/src/common/types.cpp b/src/common/types.cpp index d6698146a..9923c1a21 100644 --- a/src/common/types.cpp +++ b/src/common/types.cpp @@ -24,26 +24,26 @@ namespace love { -static StringMap types(nullptr, 0); +static StringMap types(nullptr, 0); -void addTypeName(uint32_t type, const char *name) +void addTypeName(uint32 type, const char *name) { const char *n; if (!types.find(type, n)) types.add(name, type); } -bool getTypeName(const char *in, uint32_t &out) +bool getTypeName(const char *in, uint32 &out) { return types.find(in, out); } -bool getTypeName(uint32_t in, const char *&out) +bool getTypeName(uint32 in, const char *&out) { return types.find(in, out); } -uint32_t love::Type::nextId = 1; +uint32 love::Type::nextId = 1; Type::Type(Type *parent) : inited(false) @@ -64,14 +64,14 @@ void love::Type::init() bits |= parent->bits; } -uint32_t love::Type::getId() +uint32 love::Type::getId() { if (!inited) init(); return id; } -bool love::Type::isa(const uint32_t &other) +bool love::Type::isa(const uint32 &other) { if (!inited) init(); diff --git a/src/common/types.h b/src/common/types.h index 33429cad2..302fb90da 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -21,6 +21,8 @@ #ifndef LOVE_TYPES_H #define LOVE_TYPES_H +#include "int.h" + // STD #include #include @@ -28,31 +30,31 @@ namespace love { -void addTypeName(uint32_t type, const char *name); -bool getTypeName(const char *in, uint32_t &out); -bool getTypeName(uint32_t in, const char *&out); +void addTypeName(uint32 type, const char *name); +bool getTypeName(const char *in, uint32 &out); +bool getTypeName(uint32 in, const char *&out); class Type { public: - static const uint32_t MAX_TYPES = 128; + static const uint32 MAX_TYPES = 128; // TODO: Type-checking templated constructor Type(Type *parent); Type(const Type&) = delete; - uint32_t getId(); - bool isa(const uint32_t &other); + uint32 getId(); + bool isa(const uint32 &other); bool isa(Type &other); private: - static uint32_t nextId; + static uint32 nextId; void init(); bool inited; Type *parent; - uint32_t id; + uint32 id; std::bitset bits; };