ooc-sdl2 generates weird lua stuff #769

Closed
nddrylliog opened this Issue Jan 16, 2014 · 0 comments

Projects

None yet

1 participant

@nddrylliog
Member

See:

local howling = require("howling")
local _module = howling.Module:new("sdl2/OpenGL")
local ffi = require("ffi")

local _imports = {
    "sdk:lang/Abstractions",
    "sdk:lang/Buffer",
    "sdk:lang/BufferIterator",
    "sdk:lang/Character",
    "sdk:lang/Exception",
    "sdk:lang/Format",
    "sdk:lang/IO",
    "sdk:lang/Iterators",
    "sdk:lang/Memory",
    "sdk:lang/Numbers",
    "sdk:lang/String",
    "sdk:lang/stdlib",
    "sdk:lang/types",
    "sdk:lang/VarArgs"
}

local _typesdeclared = false
function _module.declare_types()
    if _typesdeclared then return end
    _typesdeclared = true
    howling.import_types(_imports)

    ffi.cdef[[
    typedef struct ___UInt UInt;

    typedef struct ___UInt UInt;

    typedef struct ___UInt UInt;

    typedef struct ___Int Int;

    typedef struct ___Int Int;

    typedef struct ___UChar UChar;

    typedef struct ___SChar SChar;

    typedef struct ___short short;

    typedef struct ___UChar UChar;

    typedef struct ___UShort UShort;

    typedef struct ___ULong ULong;

    typedef struct ___Float Float;

    typedef struct ___Float Float;

    typedef struct ___Double Double;

    typedef struct ___Double Double;

    typedef struct ___Void Void;

    typedef struct ___LLong LLong;

    typedef struct ___ULLong ULLong;

    typedef struct ___UShort UShort;

    typedef struct ___Char Char;

    typedef struct ___UInt UInt;

    typedef struct ___Char Char;

    typedef struct ___ptrdiff_t ptrdiff_t;

    typedef struct ___ptrdiff_t ptrdiff_t;

    typedef struct ___ptrdiff_t ptrdiff_t;

    typedef struct ___ptrdiff_t ptrdiff_t;

    ]]
end

local _funcsdeclared = false
function _module.declare_and_bind_funcs()
    if _funcsdeclared then return end
    _funcsdeclared = true
    howling.import_funcs(_imports)

    ffi.cdef[[
    ]]


end

return _module

I'm not an expert, but those struct look suspicious. Also then lua complains about 'short' being typedef'd to.

@nddrylliog nddrylliog referenced this issue in fredreichbier/ooc-lua Jan 16, 2014
Closed

ooc-sdl2 generates weird lua stuff #3

@nddrylliog nddrylliog closed this Jan 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment