]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Second set of Microsoft Windows Visual C/C++ patches by Bob Goodwin.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 17 Jun 2012 18:32:55 +0000 (18:32 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 17 Jun 2012 18:32:55 +0000 (18:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@25632 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/fe/fe_values.inst.in
deal.II/source/lac/compressed_sparsity_pattern.cc
deal.II/source/lac/sparse_direct.cc
deal.II/source/lac/sparsity_pattern.cc

index 12d6ca12c6ea12ff8d306c76e5b9169ee981738b..90866f797f80a57d4dfae40d1c2f50f80f6b0a93 100644 (file)
@@ -262,10 +262,10 @@ for (deal_II_dimension : DIMENSIONS)
        (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
 
     template
-       void FEValuesViews::SymmetricTensor<2,deal_II_dimension>::get_function_values<dealii::IndexSet>
+       void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_values<dealii::IndexSet>
        (const dealii::IndexSet&, std::vector<dealii::SymmetricTensor<2,deal_II_dimension> >&) const;
     template
-       void FEValuesViews::SymmetricTensor<2,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
+       void FEValuesViews::SymmetricTensor<2,deal_II_dimension,deal_II_dimension>::get_function_divergences<dealii::IndexSet>
        (const dealii::IndexSet&, std::vector<Tensor<1,deal_II_dimension> >&) const;
 
 
index 250b0654f3a64cc9be60a3b263b73ee6d9806e42..de69bcc8f85283e7219aa52a390526573e797db2 100644 (file)
@@ -24,6 +24,9 @@
 DEAL_II_NAMESPACE_OPEN
 
 
+#ifdef DEAL_II_MSVC
+__declspec(selectany)  // weak external binding because of multiple link error
+#endif
 const unsigned int CompressedSparsityPattern::Line::cache_size;
 
 
index 2f37d8390d00fd0502883aed4dc986932b310a48..243e0966a201ceffd22d32493f30f417c9de7139 100644 (file)
 #  define __GNUC__ 3
 #endif
 
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-
+#ifndef DEAL_II_MSVC
+#  include <sys/wait.h>
+#  include <unistd.h>
 #ifndef DEAL_II_USE_DIRECT_ERRNO_H
 #  include <errno.h>
 #else
 #  include </usr/include/errno.h>
 #endif
 #include <sys/errno.h>
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <signal.h>
+
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -324,12 +328,17 @@ struct SparseDirectMA27::DetachedModeData
                                              // repeat writing until
                                              // syscall is not
                                              // interrupted
-            int ret;
+            int ret = -1;
+#ifndef DEAL_II_MSVC
             do
               ret = write (server_client_pipe[1],
                            reinterpret_cast<const char *> (t) + count,
                            sizeof(T) * N - count);
             while ((ret<0) && (errno==EINTR));
+#else
+           Assert (false,
+                   ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
             if (ret < 0)
               die ("error on client side in 'put'", ret, errno, child_pid);
 
@@ -355,12 +364,17 @@ struct SparseDirectMA27::DetachedModeData
         unsigned int count = 0;
         while (count < sizeof(T)*N)
           {
-            int ret;
+            int ret = -1;
+#ifndef DEAL_II_MSVC
             do
-              ret = read (client_server_pipe[0],
-                          reinterpret_cast<char *> (t) + count,
+              ret = write (server_client_pipe[1],
+                           reinterpret_cast<const char *> (t) + count,
                           sizeof(T) * N - count);
             while ((ret<0) && (errno==EINTR));
+#else
+           Assert (false,
+                   ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
 
             if (ret < 0)
               die ("error on client side in 'get'", ret, errno, child_pid);
@@ -406,9 +420,14 @@ SparseDirectMA27::~SparseDirectMA27()
                                          // Assign the result of write
                                          // and reset the variable to
                                          // avoid compiler warnings
-//TODO:[WB] Should t be used to trace errors?
+#ifndef DEAL_II_MSVC
+//TODO:[WB] Shouldn't t be used to trace errors?
         ssize_t t = write (detached_mode_data->server_client_pipe[1], "7", 1);
         (void)t;
+#else
+       Assert (false,
+               ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
                                          // then also delete data
         delete detached_mode_data;
         detached_mode_data = 0;
@@ -460,17 +479,28 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
                                        // Assign the return value to a
                                        // variable to avoid compiler
                                        // warnings
+#ifndef DEAL_II_MSVC
 //TODO:[WB] Use t to trace errors?
       int t = pipe(detached_mode_data->server_client_pipe);
       (void)t;
-
+#else
+      Assert (false,
+             ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
                                        // fflush(NULL) is said to be a
                                        // good idea before fork()
       std::fflush(NULL);
 
                                        // now fork and create child
                                        // process
+#ifndef DEAL_II_MSVC
+                       // BG comment out until pipes are implemented in MSVC
       detached_mode_data->child_pid = fork();
+#else
+      Assert (false,
+             ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
+
       if (detached_mode_data->child_pid == 0)
                                            // child process starts here
         {
@@ -478,6 +508,7 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
                                            // pipe to stdin, and
                                            // likewise with write end
                                            // of pipe to stdout
+#ifndef DEAL_II_MSVC
           dup2(detached_mode_data->server_client_pipe[0], 0);
           close(detached_mode_data->server_client_pipe[0]);
 
@@ -492,13 +523,19 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
           const char * const child_argv[] = { program_name, NULL };
           execv(program_name, const_cast<char * const *>(child_argv));
 
+
                                            // usually execv does not
                                            // return. if it does, then an
                                            // error happened and we report it
                                            // herewith:
-          AssertThrow (false,
-                       ExcMessage ("execv returned, which it is not supposed to do!"));
-          std::exit(1);
+         AssertThrow (false,
+                      ExcMessage ("execv returned, which it is not supposed to do!"));
+         std::exit(1);
+
+#else
+         Assert (false,
+                 ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
         };
                                        // parent process continues
                                        // here.  first thing is to
@@ -510,8 +547,13 @@ SparseDirectMA27::initialize (const SparsityPattern &sp)
                                        // process was somehow
                                        // terminated without sending
                                        // him this information
+#ifndef DEAL_II_MSVC
       const pid_t parent_pid = getpid();
       detached_mode_data->put (&parent_pid, 1, "parent_pid");
+#else
+      Assert (false,
+             ExcMessage ("Detached mode isn't currently implemented on Windows"));
+#endif
     };
 
 
index b6fbc45a23c48e3edbf0ce3aafd6e6cb1f73fc9d..1f074cd8153d37d54bcc27ffa78caf40c9637ff0 100644 (file)
@@ -29,7 +29,9 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-
+#ifdef DEAL_II_MSVC
+__declspec(selectany) // Weak extern binding due to multiple link error
+#endif
 const unsigned int SparsityPattern::invalid_entry;
 
 

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.