[vala] Fix constants used in multiple source files
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Fix constants used in multiple source files
- Date: Tue, 9 Mar 2010 10:52:40 +0000 (UTC)
commit 3f158af25a29646c5d5feffa0136bcba8b966a53
Author: Jürg Billeter <j bitron ch>
Date: Tue Mar 9 11:51:21 2010 +0100
Fix constants used in multiple source files
Fixes bug 611246.
codegen/valaccodebasemodule.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 52b0eef..5667156 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -894,7 +894,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
}
}
- public void generate_constant_declaration (Constant c, CCodeDeclarationSpace decl_space) {
+ public void generate_constant_declaration (Constant c, CCodeDeclarationSpace decl_space, bool definition = false) {
if (decl_space.add_symbol_declaration (c, c.get_cname ())) {
return;
}
@@ -912,7 +912,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
}
var cinitializer = (CCodeExpression) c.initializer.ccodenode;
- if (decl_space != source_declarations) {
+ if (!definition) {
// never output value in header
// special case needed as this method combines declaration and definition
cinitializer = null;
@@ -934,7 +934,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
}
public override void visit_constant (Constant c) {
- generate_constant_declaration (c, source_declarations);
+ generate_constant_declaration (c, source_declarations, true);
if (!c.is_internal_symbol ()) {
generate_constant_declaration (c, header_declarations);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]