]> granicus.if.org Git - gc/commitdiff
Workaround 'template-id not supported in this context' compiler error (WCC)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 1 Jun 2018 06:36:07 +0000 (09:36 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 17 Jul 2018 06:02:29 +0000 (09:02 +0300)
* include/gc_allocator.h (GC_selective_alloc<GC_true_type>): Do not
define if __WATCOMC__; add comment.

include/gc_allocator.h

index 367cfe24ff99b47c88915cdf689733162c4a1f0b..4fe3284abdfd996ca90bb4cf840e5429bf4f1d9a 100644 (file)
@@ -88,12 +88,15 @@ inline void * GC_selective_alloc(size_t n, GC_Tp, bool ignore_off_page) {
     return ignore_off_page?GC_MALLOC_IGNORE_OFF_PAGE(n):GC_MALLOC(n);
 }
 
-template <>
-inline void * GC_selective_alloc<GC_true_type>(size_t n, GC_true_type,
-                                               bool ignore_off_page) {
+#if !defined(__WATCOMC__)
+  /* Note: template-id not supported in this context by Watcom compiler. */
+  template <>
+  inline void * GC_selective_alloc<GC_true_type>(size_t n, GC_true_type,
+                                                 bool ignore_off_page) {
     return ignore_off_page? GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(n)
                           : GC_MALLOC_ATOMIC(n);
-}
+  }
+#endif
 
 /* Now the public gc_allocator<T> class:
  */