jextract unable to find limits.h from limits.h

Jorn Vernee jorn.vernee at oracle.com
Mon Nov 18 10:43:29 UTC 2019


Hi Ty,

Note that it's using # include_next <limits.h> there, in other words 
it's trying to find the next limits.h file on the include path, and 
presumably throwing an error because there is none.

What I'm confused about is that it should be picking up the clang header 
that is bundled with jextract instead, which just does:

/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
    Avert this #include_next madness. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#endif

If I do a similar jextract run (albeit on Windows) with the latest 
snapshot I don't get the same error :/

You could:
1.) Add `--log INFO` to the command and check whether the 
$JDK/conf/jextract directory is being included
2.) Check whether that directory actually exists and contains a bunch of 
header files.

Jorn

On 18/11/2019 03:04, Ty Young wrote:
> Hi,
>
>
> I tried generating bindings for libusb using:
>
>
> jextract -t org.linux.libusb -L /usr/lib -llibusb-1.0 
> --record-library-path /usr/include/libusb-1.0/libusb.h -o 
> org.linux.libusb
>
>
> but am met with:
>
>
> java.lang.RuntimeException: /usr/include/limits.h:124:16: fatal error: 
> 'limits.h' file not found
>
>
> Which is odd: jextract can't find the file causing the error while 
> reading from the file it's throwing an error about.
>
>
> This is the line's code + comment:
>
>
>  /* Get the compiler's limits.h, which defines almost all the ISO 
> constants.
>
>     We put this #include_next outside the double inclusion check because
>     it should be possible to include this file more than once and 
> still get
>     the definitions from gcc's header.  */
> #if defined __GNUC__ && !defined _GCC_LIMITS_H_
> /* `_GCC_LIMITS_H_' is what GCC's file defines.  */
> # include_next <limits.h>
> #endif
>
>
> Is this a jextract bug or am I doing something wrong?
>


More information about the panama-dev mailing list