[vala/staging: 1/2] codegen: Don't write declaration of extern functions



commit ad05ec7b1afbd84053331b2dd433153b5196d622
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 8 14:14:42 2017 +0100

    codegen: Don't write declaration of extern functions
    
    Assume that the corresponding header gets included already and therefore
    avoid a redundant-declaration.

 codegen/valaccodemethodmodule.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 1f47af9..a6ce3a1 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -195,15 +195,18 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                if (add_symbol_declaration (decl_space, m, get_ccode_name (m))) {
                        return;
                }
+               if (m.external) {
+                       return;
+               }
 
                var function = new CCodeFunction (get_ccode_name (m));
 
-               if (m.is_private_symbol () && !m.external) {
+               if (m.is_private_symbol ()) {
                        function.modifiers |= CCodeModifiers.STATIC;
                        if (m.is_inline) {
                                function.modifiers |= CCodeModifiers.INLINE;
                        }
-               } else if (context.hide_internal && m.is_internal_symbol () && !m.external) {
+               } else if (context.hide_internal && m.is_internal_symbol ()) {
                        function.modifiers |= CCodeModifiers.INTERNAL;
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]