[asterisk-scf-commits] asterisk-scf/integration/ice.git branch "generate-pragma-once" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Feb 18 12:42:54 CST 2011


branch "generate-pragma-once" has been created
        at  9611a696f3f16d6cb8c225d7fb52394cc34e1245 (commit)

- Log -----------------------------------------------------------------
commit 9611a696f3f16d6cb8c225d7fb52394cc34e1245
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 16 13:39:41 2010 -0500

    import code to generate #pragma once in headers

diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 9442aea..da5176b 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -157,12 +157,12 @@ Slice::Gen::Gen(const string& base, const string& headerExtension, const string&
 
 Slice::Gen::~Gen()
 {
-    H << "\n\n#endif\n";
+    H << "\n";
     C << '\n';
 
     if(_impl)
     {
-        implH << "\n\n#endif\n";
+        implH << "\n";
         implC << '\n';
     }
 }
@@ -229,9 +229,7 @@ Slice::Gen::generate(const UnitPtr& p)
             s = _include + '/' + s;
         }
         transform(s.begin(), s.end(), s.begin(), ToIfdef());
-        implH << "#ifndef __" << s << "__";
-        implH << "\n#define __" << s << "__";
-        implH << '\n';
+        implH << "#pragma once\n";
     }
 
     string fileH = _base + "." + _headerExtension;
@@ -266,15 +264,7 @@ Slice::Gen::generate(const UnitPtr& p)
     printGeneratedHeader(C, _base + ".ice");
 
 
-    string s = fileH;
-    if(_include.size())
-    {
-        s = _include + '/' + s;
-    }
-    transform(s.begin(), s.end(), s.begin(), ToIfdef());
-    H << "\n#ifndef __" << s << "__";
-    H << "\n#define __" << s << "__";
-    H << '\n';
+    H << "\n#pragma once\n";
 
     validateMetaData(p);
 

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice.git



More information about the asterisk-scf-commits mailing list