From dd783fb63a2945d38ff176c26bcdd96ec231a585 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 21 Nov 2006 12:00:57 +0000
Subject: [PATCH] small fixes to cgns + occ win

---
 Geo/GModel.h          |  2 --
 Geo/GModelIO_CGNS.cpp | 19 +++++++++++++++++--
 configure             |  3 +++
 configure.in          |  5 ++++-
 4 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/Geo/GModel.h b/Geo/GModel.h
index 724b49bc48..35f34dcbb0 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -177,10 +177,8 @@ class GModel
 	       double scalingFactor=1.0);
 
   // IO for CGNS files
-#if defined(HAVE_LIBCGNS)
   int readCGNS(const std::string &name);
   int writeCGNS(const std::string &name, double scalingFactor=1.0);
-#endif
 };
 
 #endif
diff --git a/Geo/GModelIO_CGNS.cpp b/Geo/GModelIO_CGNS.cpp
index 3f817d024f..26ece440ac 100644
--- a/Geo/GModelIO_CGNS.cpp
+++ b/Geo/GModelIO_CGNS.cpp
@@ -1,5 +1,3 @@
-#if defined(HAVE_LIBCGNS)
-
 // Copyright (C) 2006 S. Guzik, C. Geuzaine, J.-F. Remacle
 //
 // This program is free software; you can redistribute it and/or modify
@@ -33,6 +31,8 @@
 #include "MNeighbour.h"
 #include "MVertex.h"
 
+#if defined(HAVE_LIBCGNS)
+
 #include "cgnslib.h"
 
 int cgnsErr(const int cgIndexFile = -1)
@@ -558,4 +558,19 @@ int GModel::writeCGNS(const std::string &name, double scalingFactor)
   return 1;
 }
 
+#else
+
+int GModel::readCGNS(const std::string &name)
+{
+  Msg(GERROR, "This version of Gmsh was compiled without CGNS support");
+  return 0;
+}
+
+int GModel::writeCGNS(const std::string &name, double scalingFactor)
+{
+  Msg(GERROR, "This version of Gmsh was compiled without CGNS support");
+  return 0;
+}
+
 #endif
+
diff --git a/configure b/configure
index dcfefc0ef3..79a94ae2b4 100755
--- a/configure
+++ b/configure
@@ -4607,6 +4607,9 @@ case "$UNAME" in
     if test "x$enable_cygwin" != "xyes"; then
       FLAGS="${FLAGS} -DHAVE_NO_DLL"
     fi
+    if test "x${OCC}" = "xyes"; then
+      GMSH_LIBS="${GMSH_LIBS} -lwinspool"
+    fi
     if test "x$enable_gui" != "xno"; then
       GMSH_LIBS="${GMSH_LIBS} Fltk/Win32Icon.res"
     fi
diff --git a/configure.in b/configure.in
index 1fa5fc09ba..263d5dddda 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.111 2006-11-20 20:41:11 geuzaine Exp $
+dnl $Id: configure.in,v 1.112 2006-11-21 12:00:57 geuzaine Exp $
 dnl
 dnl Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 dnl
@@ -592,6 +592,9 @@ case "$UNAME" in
     if test "x$enable_cygwin" != "xyes"; then
       FLAGS="${FLAGS} -DHAVE_NO_DLL"
     fi
+    if test "x${OCC}" = "xyes"; then
+      GMSH_LIBS="${GMSH_LIBS} -lwinspool"
+    fi
     if test "x$enable_gui" != "xno"; then
       GMSH_LIBS="${GMSH_LIBS} Fltk/Win32Icon.res"
     fi
-- 
GitLab