1. petsc
  2. PETSc
  3. petsc

Commits

Karl Rupp  committed fda6662

Added fix for cases where C and C++ use different restrict keywords.

Reported by Geoffrey Irving on petsc-main on June 13, 2013:
In some cases C and C++ don't support the same restrict keyword, e.g.
'restrict' vs. '__restrict__'. This commit fixes the problem by
using some magic token for BuildSystem in order to 'hack' this C/C++ dispatch.

  • Participants
  • Parent commits 0a87207
  • Branches jed/next-seaice, knepley/fix-quadrature-order 3
    1. madams/sr-driver
    2. madams/sr1
    3. next-oct-2014

Comments (0)

Files changed (1)

File config/PETSc/Configure.py

View file
  • Ignore whitespace
     '''Get a generic inline keyword, depending on the language'''
     if self.languages.clanguage == 'C':
       self.addDefine('STATIC_INLINE', self.compilers.cStaticInlineKeyword)
-      self.addDefine('RESTRICT', self.compilers.cRestrict)
     elif self.languages.clanguage == 'Cxx':
       self.addDefine('STATIC_INLINE', self.compilers.cxxStaticInlineKeyword)
-      self.addDefine('RESTRICT', self.compilers.cxxRestrict)
 
+    self.addDefine('RESTRICT', self.compilers.cRestrict + '[C/CXX-SPLIT]' + self.compilers.cxxRestrict)
     if self.checkCompile('#include <dlfcn.h>\n void *ptr =  RTLD_DEFAULT;'):
       self.addDefine('RTLD_DEFAULT','1')
     return