64-bit (long) constants #296

Closed
rslemos opened this Issue Apr 6, 2012 · 2 comments

Projects

None yet

2 participants

@rslemos
rslemos commented Apr 6, 2012

From C #define

#define MAXDWORD64 ((DWORD64) 0xffffffffffffffff)

JNAerator generates

public static final long MAXDWORD64 = (long)(0xffffffffffffffff);

Javac then complains: "The literal 0xffffffffffffffff of type int is out of range".

Correct code to be generated in this case (note the "L" suffix):

public static final long MAXDWORD64 = (long)(0xffffffffffffffffL);
@rslemos rslemos closed this Apr 6, 2012
@rslemos rslemos reopened this Apr 6, 2012
@rslemos
rslemos commented Apr 6, 2012

Forgot to say: I'm using the 0.9.10-SNAPSHOT mavenized version:

<groupId>com.nativelibs4java</groupId>
<artifactId>maven-jnaerator-plugin</artifactId>
<version>0.9.10-SNAPSHOT</version>
@ochafik
Member
ochafik commented Apr 8, 2012

Hi @rslemos ,

Thanks a lot for your report !

This should be fixed in the latest Maven snapshot.

Cheers

@ochafik ochafik closed this Apr 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment