Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8225552

typedef can interfere with primitive classes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • repo-panama
    • tools

      jextract can fail if a C header file have a typedef that collides with the java.lang classes on a primitive type.

      For example, with following C header,

      typedef char Byte;
      void func(Byte byte, Byte* out);

      jextract would spit out a function like following,

      public void func(byte byte$, Pointer<Byte> out);

      and an annotation class for typedef,

      public static @interface Byte {}

      This will cause compilation errors on the static-forwarder or user code.

      The immediate thought would be trying to use --exclude-symbol to filter out Byte, but that doesn't work because symbol filter doesn't apply to typedef.

            henryjen Henry Jen
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: