From 00f97cc623469377c59985898b9b765ae66c0aee Mon Sep 17 00:00:00 2001 From: Mathieu Féry Date: Thu, 15 Jun 2023 18:44:46 +0200 Subject: feat(feature): Enable pragma once management --- src/main/java/com/jogamp/gluegen/jcpp/JCPP.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jogamp/gluegen/jcpp/JCPP.java b/src/main/java/com/jogamp/gluegen/jcpp/JCPP.java index 3e77799..3f1e057 100644 --- a/src/main/java/com/jogamp/gluegen/jcpp/JCPP.java +++ b/src/main/java/com/jogamp/gluegen/jcpp/JCPP.java @@ -43,7 +43,8 @@ public class JCPP implements GenericCPP { private final List includePaths; private final boolean enableCopyOutput2Stderr; - public JCPP(final List includePaths, final boolean debug, final boolean copyOutput2Stderr) { + public JCPP(final List includePaths, final boolean debug, final boolean copyOutput2Stderr, + final boolean enablePragmaOnce) { LOG = Logging.getLogger(JCPP.class); setOut(System.out); this.includePaths = includePaths; @@ -55,6 +56,9 @@ public class JCPP implements GenericCPP { cpp.addFeature(Feature.LINEMARKERS); cpp.addFeature(Feature.CSYNTAX); cpp.addFeature(Feature.KEEPCOMMENTS); + if (enablePragmaOnce) { + cpp.addFeature(Feature.PRAGMA_ONCE); + } cpp.addWarning(Warning.IMPORT); cpp.setListener(new DefaultPreprocessorListener() { @Override -- cgit v1.2.3