diff options
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/jogamp/common/util/IOUtil.java | 10 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/GenericCPP.java | 5 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/GlueGen.java | 5 | ||||
-rw-r--r-- | src/java/com/jogamp/gluegen/pcpp/PCPP.java | 2 |
4 files changed, 17 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java index c773b21..88542c4 100644 --- a/src/java/com/jogamp/common/util/IOUtil.java +++ b/src/java/com/jogamp/common/util/IOUtil.java @@ -39,6 +39,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; +import java.io.Reader; import java.lang.ref.WeakReference; import java.lang.reflect.Constructor; import java.net.URISyntaxException; @@ -188,6 +189,15 @@ public class IOUtil { return numBytes; } + public static StringBuilder appendCharStream(final StringBuilder sb, final Reader r) throws IOException { + final char[] cbuf = new char[1024]; + int count; + while( 0 < ( count = r.read(cbuf) ) ) { + sb.append(cbuf, 0, count); + } + return sb; + } + /** * Copy the specified input stream to a byte array, which is being returned. */ diff --git a/src/java/com/jogamp/gluegen/GenericCPP.java b/src/java/com/jogamp/gluegen/GenericCPP.java index 85c8e65..db414d9 100644 --- a/src/java/com/jogamp/gluegen/GenericCPP.java +++ b/src/java/com/jogamp/gluegen/GenericCPP.java @@ -31,7 +31,7 @@ import java.io.OutputStream; import java.io.Reader; import java.util.List; -import org.anarres.cpp.LexerException; +import com.jogamp.gluegen.jcpp.LexerException; /** * Generic C preprocessor interface for GlueGen @@ -55,8 +55,9 @@ public interface GenericCPP { * May return an empty list, in case this preprocessor does not * store {@link ConstantDefinition}s. * </p> + * @throws GlueGenException */ - public List<ConstantDefinition> getConstantDefinitions(); + public List<ConstantDefinition> getConstantDefinitions() throws GlueGenException; }
\ No newline at end of file diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index 20e1efa..4153518 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -49,7 +49,7 @@ import antlr.*; import com.jogamp.gluegen.cgram.*; import com.jogamp.gluegen.cgram.types.*; -import com.jogamp.gluegen.pcpp.*; +import com.jogamp.gluegen.jcpp.JCPP; import static java.lang.System.*; @@ -136,7 +136,8 @@ public class GlueGen implements GlueEmitterControls { out.deleteOnExit(); } - preprocessor = new PCPP(includePaths, debug, copyPCPPOutput2Stderr); + // preprocessor = new PCPP(includePaths, debug, copyPCPPOutput2Stderr); + preprocessor = new JCPP(includePaths, debug, copyPCPPOutput2Stderr); preprocessor.addDefine(__GLUEGEN__, "2"); preprocessor.setOut(outStream); diff --git a/src/java/com/jogamp/gluegen/pcpp/PCPP.java b/src/java/com/jogamp/gluegen/pcpp/PCPP.java index a06b8ee..c766634 100644 --- a/src/java/com/jogamp/gluegen/pcpp/PCPP.java +++ b/src/java/com/jogamp/gluegen/pcpp/PCPP.java @@ -137,7 +137,7 @@ public class PCPP implements GenericCPP { } @Override - public List<ConstantDefinition> getConstantDefinitions() { + public List<ConstantDefinition> getConstantDefinitions() throws GlueGenException { return new ArrayList<ConstantDefinition>(); // NOP } |