Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ooc-sdl2 generates weird lua stuff #769

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

ooc-sdl2 generates weird lua stuff #769

nddrylliog opened this issue Jan 16, 2014 · 0 comments

Comments

@nddrylliog
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant