]> 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>
Sat, 7 Jul 2018 12:16:10 +0000 (15:16 +0300)
* include/gc_allocator.h (GC_selective_alloc<GC_true_type>): Do not
define if __WATCOMC__; add comment.

include/gc_allocator.h

index 9d70ed5ad30c2501981ffecc1351a274edf35b41..7d1d18620153109963e57465ba7dbe5e4e120909 100644 (file)
@@ -90,12 +90,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:
  */