Search code examples
javacmacrosjna

JNA macro function in #define


I am trying ported spidev.h to java using JNA.

How i can port #define SPI_IOC_RD_MODE_IOR(SPI_IOC_MAGIC, 1, __u8) from c to java using JNA?


Solution

  • You can't "port" a macro definition (here SPI_IOC_RD_MODE) to java. JNA may help you to call _IOR if this happens to be an exported function of a certain dll.