[vala/staging] codegen: Add replacement for G_(BEGIN|END)_DECLS in non GOBJECT profile
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Add replacement for G_(BEGIN|END)_DECLS in non GOBJECT profile
- Date: Sat, 3 Nov 2018 13:49:22 +0000 (UTC)
commit 846c5d70f24f14fa57e15687acef69057ce272b6
Author: Alistair Thomas <astavale yahoo co uk>
Date: Sat Nov 3 14:28:52 2018 +0100
codegen: Add replacement for G_(BEGIN|END)_DECLS in non GOBJECT profile
Fixes https://gitlab.gnome.org/GNOME/vala/issues/622
codegen/valaccodebasemodule.vala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 56a91f347..394d710e1 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -544,7 +544,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (context.profile == Profile.GOBJECT) {
ret = header_file.store (context.header_filename, null,
context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
} else {
- ret = header_file.store (context.header_filename, null,
context.version_header, false);
+ ret = header_file.store (context.header_filename, null,
context.version_header, false, "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef
__cplusplus\n}\n#endif");
}
if (!ret) {
Report.error (null, "unable to open `%s' for writing".printf
(context.header_filename));
@@ -557,7 +557,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
if (context.profile == Profile.GOBJECT) {
ret = internal_header_file.store (context.internal_header_filename, null,
context.version_header, false, "G_BEGIN_DECLS", "G_END_DECLS");
} else {
- ret = internal_header_file.store (context.internal_header_filename, null,
context.version_header, false);
+ ret = internal_header_file.store (context.internal_header_filename, null,
context.version_header, false, "#ifdef __cplusplus\nextern \"C\" {\n#endif", "#ifdef
__cplusplus\n}\n#endif");
}
if (!ret) {
Report.error (null, "unable to open `%s' for writing".printf
(context.internal_header_filename));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]