]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.h
[msvc] Work around strange scoping and name mangling rules.
[ginac.git] / ginac / ex.h
index f0e6db51f150b302393882064f7411222ff277cc..d7bbf6df4a0c09abce7a7ba7a358d576c3b265ae 100644 (file)
 #include <stack>
 
 namespace GiNaC {
+#ifdef _MSC_VER
+  // MSVC produces a different symbol for _ex0 when it is declared inside   
+  // ex::is_zero() than when it is declared at top level as follows
+  extern const ex _ex0;
+#endif
 
 /** Helper class to initialize the library.  There must be one static object
  *  of this class in every object file that makes use of our flyweights in
@@ -204,7 +209,12 @@ public:
        // comparison
        int compare(const ex & other) const;
        bool is_equal(const ex & other) const;
-       bool is_zero() const { extern const ex _ex0; return is_equal(_ex0); }
+       bool is_zero() const { 
+#ifndef _MSC_VER
+         extern const ex _ex0;
+#endif
+         return is_equal(_ex0); 
+       }
        bool is_zero_matrix() const;
        
        // symmetry