[c2hs] #48: Interpreted an int64_t typedef as CInt
#48: Interpreted an int64_t typedef as CInt --------------------+------------------------------------------------------- Reporter: guest | Type: defect Status: new | Priority: blocker Milestone: | Component: general Version: 0.16.2 | Keywords: --------------------+------------------------------------------------------- A library I'd like to write bindings to has a typedef of int64_t to a library-specific type name. c2hs seems to interpret that type as CInt, both in foreign import declarations and in {# type #} directives. It should interpret that type as a 64-bit integer type instead. -- Ticket URL: <http://hackage.haskell.org/trac/c2hs/ticket/48> c2hs <http://www.cse.unsw.edu.au/~chak/haskell/c2hs/> C->Haskell, An Interface Generator for Haskell
#48: Interpreted an int64_t typedef as CInt --------------------+------------------------------------------------------- Reporter: guest | Type: defect Status: new | Priority: blocker Milestone: | Component: general Version: 0.16.2 | Keywords: --------------------+------------------------------------------------------- Comment(by guest): I managed to track down the problem. Turns out that the header in question indirectly includes <sys/types.h> before it includes <stdint.h>, and <sys/types.h> defines int64_t in a way that c2hs doesn't know how to handle: {{{ $ cpp /usr/include/stdint.h | grep -w int64_t typedef long int int64_t; $ cpp /usr/include/sys/types.h | grep -w int64_t typedef int int64_t __attribute__ ((__mode__ (__DI__))); }}} I'd guess that c2hs ignores the GCC-specific __attribute__ that overrides the size, and just sees "int". -- Ticket URL: <http://hackage.haskell.org/trac/c2hs/ticket/48#comment:1> c2hs <http://www.cse.unsw.edu.au/~chak/haskell/c2hs/> C->Haskell, An Interface Generator for Haskell
participants (1)
-
c2hs