From: Ivan Maidanski Date: Fri, 1 Jun 2018 06:36:07 +0000 (+0300) Subject: Workaround 'template-id not supported in this context' compiler error (WCC) X-Git-Tag: v7.6.8~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b432afdfdf01b6a2a51017e407fb9e5b80499db;p=gc Workaround 'template-id not supported in this context' compiler error (WCC) * include/gc_allocator.h (GC_selective_alloc): Do not define if __WATCOMC__; add comment. --- diff --git a/include/gc_allocator.h b/include/gc_allocator.h index 9d70ed5a..7d1d1862 100644 --- a/include/gc_allocator.h +++ b/include/gc_allocator.h @@ -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(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(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 class: */