]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/list.tcc
release: 1.1.42
[lilypond.git] / flower / include / list.tcc
index 06aa312bc30a4517f59b0ff28d7fde2dfb275438..3c66774faf7890eb7b503524dc268edc14abbba1 100644 (file)
@@ -3,16 +3,12 @@
 
   source file of the Flower Library
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #ifndef LIST_CC
 #define LIST_CC
 
 
-// instantiate a template:  explicit instantiation.
-#define LIST_INSTANTIATE(a)   class List<a>; template class Cursor<a>; \
-  template class Link<a>
-
 #include "list.hh"
 
 template<class T>
@@ -80,7 +76,7 @@ void
 List<T>::add (T const & thing, Cursor<T> &after_me)
 {
   if (!size_) {                // not much choice if list is empty
-      bottom_ = top_ = new Link<T>( thing);
+      bottom_ = top_ = new Link<T>(thing);
        if (!after_me.ok())
            after_me = bottom();
     }
@@ -102,7 +98,7 @@ List<T>::insert (T const & thing, Cursor<T> &before_me)
 {
   if (!size_) 
     {
-       bottom_ = top_ = new Link<T>( thing);
+       bottom_ = top_ = new Link<T>(thing);
        if (!before_me.ok())
            before_me = top();
        
@@ -134,4 +130,22 @@ List<T>::concatenate (List<T> const&s)
        b++;
     }
 }
+
+#ifndef __CYGWIN32__ // ugh should check for some gcc/egcs version
+
+// instantiate a template:  explicit instantiation.
+#define LIST_INSTANTIATE(a)  template class List<a>; \
+  template class Cursor<a>; template class Link<a>
+
+#else
+
+#define LIST_INSTANTIATE(T)\
+    static void force_list_members ()\
+    {\
+    List<T> bla;\
+    bla.top().add ((void*)0);\
+    }
 #endif
+
+#endif
+