summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/gluegen/GlueGen.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-11-09 00:32:37 +0000
committerKenneth Russel <[email protected]>2005-11-09 00:32:37 +0000
commitcf7b8b87f78687b8e4a867d3b18bd7f072a955ee (patch)
tree739fe8eec21acfe26cf7a684232f1219dbdd43b8 /src/classes/com/sun/gluegen/GlueGen.java
parente42abe5e45c693abc4c06ac5c1928ee2c3fe8d27 (diff)
Refactored computations of sizes of data types and offsets of fields
in data structures in GlueGen to be performed lazily via SizeThunks. The concrete size of primitive data types is computed only by passing a MachineDescription into one of these thunks. Changed generated glue code for struct accessors to delegate their instantiation and field access to specialized 32- or 64-bit versions. This should allow one jar file to support both 32-bit and 64-bit CPUs; the native code is of course still specialized for the processor and data model. Changed default build to generate both 32-bit and 64-bit accessors for all generated data structures. Tested on Windows; more testing, including build testing, is needed on other platforms. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@426 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/GlueGen.java')
-rw-r--r--src/classes/com/sun/gluegen/GlueGen.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/classes/com/sun/gluegen/GlueGen.java b/src/classes/com/sun/gluegen/GlueGen.java
index c192ae8cd..a7c64a840 100644
--- a/src/classes/com/sun/gluegen/GlueGen.java
+++ b/src/classes/com/sun/gluegen/GlueGen.java
@@ -146,16 +146,6 @@ public class GlueGen implements GlueEmitterControls {
}
HeaderParser headerParser = new HeaderParser();
- MachineDescription machDesc;
- String os = System.getProperty("os.name").toLowerCase();
- String cpu = System.getProperty("os.arch").toLowerCase();
- if ((os.startsWith("linux") && cpu.equals("amd64")) ||
- (os.startsWith("linux") && cpu.equals("ia64"))) {
- machDesc = new MachineDescription64Bit();
- } else {
- machDesc = new MachineDescription32Bit();
- }
- headerParser.setMachineDescription(machDesc);
TypeDictionary td = new TypeDictionary();
headerParser.setTypedefDictionary(td);
TypeDictionary sd = new TypeDictionary();
@@ -190,8 +180,10 @@ public class GlueGen implements GlueEmitterControls {
emit.readConfigurationFile((String) iter.next());
}
- // provide MachineDescription to emitter if it needs it
- emit.setMachineDescription(machDesc);
+ // Provide MachineDescriptions to emitter
+ MachineDescription md32 = new MachineDescription32Bit();
+ MachineDescription md64 = new MachineDescription64Bit();
+ emit.setMachineDescription(md32, md64);
// begin emission of glue code
emit.beginEmission(this);