jna/jna-3.0.4-structure-reason.patch
2008-09-06 22:13:22 +00:00

47 lines
1.7 KiB
Diff

diff -ur jna-3.0.4-svn630/src/com/sun/jna/Structure.java jna-3.0.4-svn630.orig/src/com/sun/jna/Structure.java
--- jna-3.0.4-svn630/src/com/sun/jna/Structure.java 2008-07-31 13:44:21.000000000 -0400
+++ jna-3.0.4-svn630.orig/src/com/sun/jna/Structure.java 2008-09-05 21:47:51.000000000 -0400
@@ -126,8 +126,16 @@
}
protected Structure(int size, int alignment) {
+ this(size, alignment, null);
+ }
+
+ protected Structure(TypeMapper mapper) {
+ this(CALCULATE_SIZE, ALIGN_DEFAULT, mapper);
+ }
+
+ protected Structure(int size, int alignment, TypeMapper mapper) {
setAlignType(alignment);
- setTypeMapper(null);
+ setTypeMapper(mapper);
allocateMemory(size);
}
@@ -974,7 +982,8 @@
}
catch(IllegalArgumentException e) {
throw new IllegalArgumentException("The type \"" + type.getName()
- + "\" is not supported as a structure field");
+ + "\" is not supported as a structure field: "
+ + e.getMessage());
}
}
diff -ur jna-3.0.4-svn630/src/com/sun/jna/Union.java jna-3.0.4-svn630.orig/src/com/sun/jna/Union.java
--- jna-3.0.4-svn630/src/com/sun/jna/Union.java 2008-07-31 13:44:21.000000000 -0400
+++ jna-3.0.4-svn630.orig/src/com/sun/jna/Union.java 2008-09-05 21:47:18.000000000 -0400
@@ -39,6 +39,11 @@
protected Union(int size, int alignType) {
super(size, alignType);
}
+
+ protected Union(TypeMapper mapper) {
+ super(mapper);
+ }
+
/** Indicates which field will be used to write to native memory.
* @throws IllegalArgumentException if the type does not correspond to
* any declared union field.