From 7865b355bd52958f4b27e42b500e83c52255ef37 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 9 Nov 2010 02:42:03 +0100
Subject: Gluegen: Types (stddef/stdint), Header and Predefined Macro Change

Read API doc ad GlueGen.java

New predefined types: wchar_t, intptr_t, uintptr_t

New reusable headers
  for gluegen usage: make/stub_includes/gluegen
  for native  usage: make/stub_includes/platform

New predefined macro
  #define __GLUEGEN__ 2
---
 src/java/com/jogamp/gluegen/GlueGen.java | 59 ++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 11 deletions(-)

(limited to 'src/java/com/jogamp/gluegen/GlueGen.java')

diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java
index f24d0b2..e88538e 100644
--- a/src/java/com/jogamp/gluegen/GlueGen.java
+++ b/src/java/com/jogamp/gluegen/GlueGen.java
@@ -51,21 +51,57 @@ import static java.lang.System.*;
 
 /** 
  * Glue code generator for C functions and data structures.<br>
- * <br>
+ * <p>
+ * <h4>GlueGen Data Type Mapping</h4>
  * Gluegen has build-in types (terminal symbols) for:<br>
  * <br>
  * <table border="1">
- *   <tr><th>type</th>      <th>java</th> <th>native-x32</th><th>native-x64</th><th>type</th>   <th>signed</th></tr>
- *   <tr><th>__int32</th>   <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>signed or unsigned</th></tr>
- *   <tr><th>int32_t</th>   <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>signed</th></tr>
- *   <tr><th>uint32_t</th>  <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>unsigned</th></tr>
- *   <tr><th>__int64</th>   <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>signed or unsigned</th></tr>
- *   <tr><th>int64_t</th>   <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>signed</th></tr>
- *   <tr><th>uint64_t</th>  <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>unsigned</th></tr>
- *   <tr><th>ptrdiff_t</th> <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>signed</th></tr>
- *   <tr><th>size_t</th>    <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>unsigned</th></tr>
- * </table>
+ *   <tr><th>type</th>      <th>java</th> <th>native-x32</th><th>native-x64</th><th>type</th>   <th>signed</th>            <th>origin</th</tr>
+ *   <tr><th>__int32</th>   <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>signed or unsigned</th><th>windows</th></tr>
+ *   <tr><th>int32_t</th>   <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>signed</th>            <th>stdint.h</th></tr>
+ *   <tr><th>wchar_t</th>   <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>signed</th>            <th>stddef.h</th></tr>
+ *   <tr><th>uint32_t</th>  <th>32bit</th><th>32bit</th>     <th>32bit</th>     <th>integer</th><th>unsigned</th>          <th>stdint.h</th></tr>
+ *   <tr><th>__int64</th>   <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>signed or unsigned</th><th>windows</th></tr>
+ *   <tr><th>int64_t</th>   <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>signed</th>            <th>stdint.h</th></tr>
+ *   <tr><th>uint64_t</th>  <th>64bit</th><th>64bit</th>     <th>64bit</th>     <th>integer</th><th>unsigned</th>          <th>stdint.h</th></tr>
+ *   <tr><th>ptrdiff_t</th> <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>signed</th>            <th>stddef.h</th></tr>
+ *   <tr><th>intptr_t</th>  <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>signed</th>            <th>stdint.h</th></tr>
+ *   <tr><th>size_t</th>    <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>unsigned</th>          <th>stddef.h</th></tr>
+ *   <tr><th>uintptr_t</th> <th>64bit</th><th>32bit</th>     <th>64bit</th>     <th>integer</th><th>unsigned</th>          <th>stdint.h</th></tr>
+ * </table></p>
+ * <p>
+ * <h4>GlueGen Platform Header Files</h4>
+ * GlueGen provides convenient platform headers,<br>
+ * which can be included in your C header files for native compilation and GlueGen code generation.<br>
+ * <br>
+ * Example:<br>
+ * <pre>
+   #include &lt;gluegen_stdint.h&gt;
+   #include &lt;gluegen_stddef.h&gt;
+ 
+   uint64_t test64;
+   size_t size1;
+   ptrdiff_t ptr1;
+ * </pre>
+ * <br>
+ * To compile this file you have to include the following folder to your compilers system includes, ie <code>-I</code>:<br>
+ * <pre>
+ *   gluegen/make/stub_includes/platform
+ * </pre>
+ * <br>
+ * To generate code for this file you have to include the following folder to your GlueGen <code>includeRefid</code> element:<br>
+ * <pre>
+ *   gluegen/make/stub_includes/gluegen
+ * </pre></p>
+ * <p>
+ * <h4>GlueGen Pre-Defined Macros</h4>
+ * To identity a GlueGen code generation run, GlueGen defines the following macros:<br>
+ * <pre>
+     #define __GLUEGEN__ 2
+ * </pre>
+ * </p>
  */
+
 public class GlueGen implements GlueEmitterControls {
 
     static{
@@ -117,6 +153,7 @@ public class GlueGen implements GlueEmitterControls {
             }
 
             preprocessor = new PCPP(includePaths, debug, copyPCPPOutput2Stderr);
+            preprocessor.addDefine("__GLUEGEN__", "2");
             preprocessor.setOut(outStream);
 
             preprocessor.run(reader, filename);
-- 
cgit v1.2.3