Skip to content

Commit

Permalink
Add type definitions for stdint.h and stddef.h
Browse files Browse the repository at this point in the history
Fixes #749
  • Loading branch information
larskanis committed Apr 16, 2020
1 parent 4f1dcd2 commit acd1ed3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/ffi/platform/x86_64-linux/types.conf
Expand Up @@ -73,6 +73,15 @@ rbx.platform.typedef.int16_t = short
rbx.platform.typedef.int32_t = int
rbx.platform.typedef.int64_t = long
rbx.platform.typedef.int8_t = char
rbx.platform.typedef.int_fast16_t = long
rbx.platform.typedef.int_fast32_t = long
rbx.platform.typedef.int_fast64_t = long
rbx.platform.typedef.int_fast8_t = char
rbx.platform.typedef.int_least32_t = int
rbx.platform.typedef.int_least64_t = long
rbx.platform.typedef.int_least8_t = char
rbx.platform.typedef.intmax_t = long
rbx.platform.typedef.intptr_t = long
rbx.platform.typedef.key_t = int
rbx.platform.typedef.loff_t = long
rbx.platform.typedef.mode_t = uint
Expand All @@ -82,6 +91,7 @@ rbx.platform.typedef.pid_t = int
rbx.platform.typedef.pthread_key_t = uint
rbx.platform.typedef.pthread_once_t = int
rbx.platform.typedef.pthread_t = ulong
rbx.platform.typedef.ptrdiff_t = long
rbx.platform.typedef.quad_t = long
rbx.platform.typedef.register_t = long
rbx.platform.typedef.rlim_t = ulong
Expand All @@ -107,5 +117,16 @@ rbx.platform.typedef.uint16_t = ushort
rbx.platform.typedef.uint32_t = uint
rbx.platform.typedef.uint64_t = ulong
rbx.platform.typedef.uint8_t = uchar
rbx.platform.typedef.uint_fast16_t = ulong
rbx.platform.typedef.uint_fast32_t = ulong
rbx.platform.typedef.uint_fast64_t = ulong
rbx.platform.typedef.uint_fast8_t = uchar
rbx.platform.typedef.uint_least16_t = ushort
rbx.platform.typedef.uint_least32_t = uint
rbx.platform.typedef.uint_least64_t = ulong
rbx.platform.typedef.uint_least8_t = uchar
rbx.platform.typedef.uintmax_t = ulong
rbx.platform.typedef.uintptr_t = ulong
rbx.platform.typedef.ulong = ulong
rbx.platform.typedef.ushort = ushort
rbx.platform.typedef.wchar_t = int
2 changes: 2 additions & 0 deletions lib/ffi/tools/types_generator.rb
Expand Up @@ -47,6 +47,8 @@ def self.generate(options = {})
typedefs = nil
Tempfile.open 'ffi_types_generator' do |io|
io.puts <<-C
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#if !(defined(WIN32))
#include <sys/socket.h>
Expand Down

0 comments on commit acd1ed3

Please sign in to comment.