From b6afec3039e97ffcc2fc90a42877c1394700229d Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 1 Jun 2018 09:36:07 +0300 Subject: [PATCH] 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. --- include/gc_allocator.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/gc_allocator.h b/include/gc_allocator.h index 9d70ed5..7d1d186 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: */ -- 2.7.4