aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/CodeGenUtils.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-06-16 00:59:29 +0200
committerSven Gothel <[email protected]>2023-06-16 00:59:29 +0200
commitf1678c4ac8b85c85d11b737d08dcfe31b388e021 (patch)
treec13c672ad97b9a17892690e56353961215033ceb /src/java/com/jogamp/gluegen/CodeGenUtils.java
parent03c548d96e5c81d0fc39503fe3042cf03e0a75e2 (diff)
GlueGen Struct [2]: Add CodeUnit: Representing a generated C or Java file, covering multiple FunctionEmitter allowing to unify output, decoration and dynamic helper code injection per unit
- Handles file open and have public ctor emitAutogeneratedWarning(..), being self-contained - Includes `JVMUtil_NewDirectByteBufferCopy(..)` implementation in CCodeUnit, may be injected if required in customCode via emitHeader(..)
Diffstat (limited to 'src/java/com/jogamp/gluegen/CodeGenUtils.java')
-rw-r--r--src/java/com/jogamp/gluegen/CodeGenUtils.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/com/jogamp/gluegen/CodeGenUtils.java b/src/java/com/jogamp/gluegen/CodeGenUtils.java
index 221256b..76116f1 100644
--- a/src/java/com/jogamp/gluegen/CodeGenUtils.java
+++ b/src/java/com/jogamp/gluegen/CodeGenUtils.java
@@ -56,8 +56,9 @@ public class CodeGenUtils {
/**
* @param generator the object that is emitting the autogenerated code. If
* null, the generator will not be mentioned in the warning message.
+ * @param customLine maybe null
*/
- public static void emitAutogeneratedWarning(final PrintWriter w, final Object generator) {
+ public static void emitAutogeneratedWarning(final PrintWriter w, final Object generator, final String customLine) {
w.print("/* !---- DO NOT EDIT: This file autogenerated ");
if (generator != null) {
w.print("by ");
@@ -67,6 +68,11 @@ public class CodeGenUtils {
w.print("on ");
w.print((new Date()).toString());
w.println(" ----! */");
+ if( null != customLine && customLine.length() > 0 ) {
+ w.print("/* !---- ");
+ w.print(customLine);
+ w.println(" ----! */");
+ }
w.println();
}