From 7825c4c053e0755e5dc0aa20127914887efa75e4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Jun 2023 04:33:54 +0200 Subject: CPP Enable Pragma Once: Default is 'true', since usually all compiler and APIs do support this feature --- src/java/com/jogamp/gluegen/GlueGen.java | 7 +++++-- .../com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index beeb918..f2a5c6b 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -380,7 +380,7 @@ public class GlueGen implements GlueEmitterControls { String outputRootDir = null; final List cfgFiles = new ArrayList(); boolean copyCPPOutput2Stderr = false; - boolean enablePragmaOnce = false; + boolean enablePragmaOnce = true; final List includePaths = new ArrayList(); for (int i = 0; i < args.length; i++) { @@ -404,6 +404,8 @@ public class GlueGen implements GlueEmitterControls { copyCPPOutput2Stderr=true; } else if (arg.equals("--enablePragmaOnce")) { enablePragmaOnce=true; + } else if (arg.equals("--disablePragmaOnce")) { + enablePragmaOnce=true; } else { usage(); } @@ -453,7 +455,8 @@ public class GlueGen implements GlueEmitterControls { out.println("-Cjava-emitter.cfg."); out.println(" --debug enables debug mode"); out.println(" --dumpCPP directs CPP to dump all output to stderr as well"); - out.println(" --enablePragmaOnce allow handle of #pragma once directive during parsing"); + out.println(" --enablePragmaOnce allow handle of #pragma once directive during parsing (default)"); + out.println(" --disablePragmaOnce disable handling of #pragma once directive during parsing"); exit(1); } } diff --git a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java index d785dad..1072675 100644 --- a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java +++ b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java @@ -100,7 +100,7 @@ public class CStructAnnotationProcessor extends AbstractProcessor { private static final String STRUCTGENOUTPUT_OPTION = "structgen.output"; private static final String STRUCTGENPRAGMA_ONCE = "structgen.enable.pragma.once"; private static final String STRUCTGENOUTPUT = PropertyAccess.getProperty("jogamp.gluegen."+STRUCTGENOUTPUT_OPTION, true, "gensrc"); - private static final String STRUCTGENPRAGMAONCE = PropertyAccess.getProperty("jogamp.gluegen."+STRUCTGENPRAGMA_ONCE, true, "false"); + private static final String STRUCTGENPRAGMAONCE = PropertyAccess.getProperty("jogamp.gluegen."+STRUCTGENPRAGMA_ONCE, true, "true"); private Filer filer; private Messager messager; -- cgit v1.2.3