]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Sundials: Mark function as inline 11781/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 20 Feb 2021 00:19:15 +0000 (18:19 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 20 Feb 2021 00:19:15 +0000 (18:19 -0600)
These two functions have a complete definition in a header file that
gets including in multiple compilation units. In this case we have to
mark these functions as "inline" so that the compiler emits a so-called
"weak symbol". Otherwise linkage will fail due to multiply defined
symbols.

include/deal.II/sundials/sunlinsol_newempty.h

index b992d66c238b1b056e0c45e06facad6417350316..d0d1fb1484e98e7b063973f262c26f5ee219f644 100644 (file)
@@ -41,7 +41,7 @@ namespace SUNDIALS
      * Create a new SUNLinearSolver structure without any content and
      * operations set to `nullptr`.
      */
-    SUNLinearSolver
+    inline SUNLinearSolver
     SUNLinSolNewEmpty()
     {
       /* create linear solver object */
@@ -80,7 +80,7 @@ namespace SUNDIALS
      *
      * @param solver The solver memory to free
      */
-    void
+    inline void
     SUNLinSolFreeEmpty(SUNLinearSolver solver)
     {
       if (solver == nullptr)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.