From 68fa7164e93ef9376ee6699b11f8c62b16873e61 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 17 Feb 2003 16:32:37 +0000
Subject: [PATCH] Don't use LITTLE_ENDIAN, it may be defined on Macs and cause
 the colormap problems. Define and test _BIG_ENDIAN instead.

Change NODLL to _NO_DLL
---
 Common/Context.h  | 14 +++++++-------
 Plugin/Plugin.cpp |  6 +++---
 configure         | 12 ++++++------
 configure.in      | 12 ++++++------
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/Common/Context.h b/Common/Context.h
index 576e698776..a03b955e11 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -24,18 +24,18 @@
 
 // How RGBA values are packed and unpacked into/from a 4-byte integer 
 
-#ifdef LITTLE_ENDIAN
-#  define PACK_COLOR(R,G,B,A)   ( (A)<<24 | (B)<<16 | (G)<<8 | (R) )
-#  define UNPACK_RED(X)         ( (X) & 0xff )
-#  define UNPACK_GREEN(X)       ( ( (X) >> 8 ) & 0xff )
-#  define UNPACK_BLUE(X)        ( ( (X) >> 16 ) & 0xff )
-#  define UNPACK_ALPHA(X)       ( ( (X) >> 24 ) & 0xff )
-#else
+#if defined(_BIG_ENDIAN)
 #  define PACK_COLOR(R,G,B,A)   ( (R)<<24 | (G)<<16 | (B)<<8 | (A) )
 #  define UNPACK_RED(X)         ( ( (X) >> 24 ) & 0xff )
 #  define UNPACK_GREEN(X)       ( ( (X) >> 16 ) & 0xff )
 #  define UNPACK_BLUE(X)        ( ( (X) >> 8 ) & 0xff )
 #  define UNPACK_ALPHA(X)       ( (X) & 0xff )
+#else
+#  define PACK_COLOR(R,G,B,A)   ( (A)<<24 | (B)<<16 | (G)<<8 | (R) )
+#  define UNPACK_RED(X)         ( (X) & 0xff )
+#  define UNPACK_GREEN(X)       ( ( (X) >> 8 ) & 0xff )
+#  define UNPACK_BLUE(X)        ( ( (X) >> 16 ) & 0xff )
+#  define UNPACK_ALPHA(X)       ( ( (X) >> 24 ) & 0xff )
 #endif
 
 // Interface-independent context 
diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp
index 7557ef4791..5bd2198d2c 100644
--- a/Plugin/Plugin.cpp
+++ b/Plugin/Plugin.cpp
@@ -1,4 +1,4 @@
-// $Id: Plugin.cpp,v 1.35 2003-02-12 20:27:14 geuzaine Exp $
+// $Id: Plugin.cpp,v 1.36 2003-02-17 16:32:37 geuzaine Exp $
 //
 // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
 //
@@ -19,7 +19,7 @@
 // 
 // Please report all bugs and problems to "gmsh@geuz.org".
 
-#if !defined(NODLL)
+#if !defined(_NO_DLL)
 #include <dlfcn.h>
 #endif
 
@@ -161,7 +161,7 @@ void GMSH_PluginManager::RegisterDefaultPlugins(){
 
 void GMSH_PluginManager::AddPlugin( char *dirName, char *pluginName){
 
-#if defined(NODLL) || !defined(HAVE_FLTK)
+#if defined(_NO_DLL) || !defined(HAVE_FLTK)
   Msg(WARNING,"No dynamic plugin loading on this platform");
   return;
 #else
diff --git a/configure b/configure
index 517dbfa390..d72dac04b3 100755
--- a/configure
+++ b/configure
@@ -3199,12 +3199,12 @@ case "$UNAME" in
     ;;
 
   Darwin*)
-    OS_FLAGS="${OS_FLAGS} -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_NO_DLL"
     POSTBUILD="/Developer/Tools/Rez -t APPL -o bin/gmsh Fltk/MacRes.r"
     ;;
 
   AIX*)
-    OS_FLAGS="${OS_FLAGS} -D_BSD -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_BSD -D_NO_DLL"
     ;;
 
   IRIX*)
@@ -3217,12 +3217,12 @@ case "$UNAME" in
     ;;
 
   SunOS*)
-    OS_FLAGS="${OS_FLAGS} -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_NO_DLL"
     GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
     ;;
 
   HP-UX*)
-    OS_FLAGS="-DNODLL"
+    OS_FLAGS="-D_NO_DLL"
     ;;
 
 esac
@@ -3414,9 +3414,9 @@ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
 echo "${ECHO_T}$ac_cv_c_bigendian" >&6
 case $ac_cv_c_bigendian in
   yes)
-    OS_FLAGS="${OS_FLAGS}" ;;
+    OS_FLAGS="${OS_FLAGS} -D_BIG_ENDIAN" ;;
   no)
-    OS_FLAGS="-DLITTLE_ENDIAN ${OS_FLAGS}" ;;
+     ;;
   *)
     { { echo "$as_me:$LINENO: error: unknown endianess
 presetting ac_cv_c_bigendian=no (or yes) will help" >&5
diff --git a/configure.in b/configure.in
index 9e8ab82564..a3bcfc73cc 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-dnl "$Id: configure.in,v 1.22 2003-02-17 01:52:55 geuzaine Exp $"
+dnl "$Id: configure.in,v 1.23 2003-02-17 16:32:37 geuzaine Exp $"
 dnl
 dnl Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
 dnl
@@ -162,12 +162,12 @@ case "$UNAME" in
     ;;
 
   Darwin*)
-    OS_FLAGS="${OS_FLAGS} -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_NO_DLL"
     POSTBUILD="/Developer/Tools/Rez -t APPL -o bin/gmsh Fltk/MacRes.r"
     ;;
 
   AIX*)
-    OS_FLAGS="${OS_FLAGS} -D_BSD -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_BSD -D_NO_DLL"
     ;;
 
   IRIX*)
@@ -180,18 +180,18 @@ case "$UNAME" in
     ;;
 
   SunOS*)
-    OS_FLAGS="${OS_FLAGS} -DNODLL"
+    OS_FLAGS="${OS_FLAGS} -D_NO_DLL"
     GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
     ;;
 
   HP-UX*)
-    OS_FLAGS="-DNODLL"
+    OS_FLAGS="-D_NO_DLL"
     ;;
 
 esac
 
 dnl Is the machine big or littke endian?
-AC_C_BIGENDIAN(OS_FLAGS="${OS_FLAGS}",OS_FLAGS="-DLITTLE_ENDIAN ${OS_FLAGS}")
+AC_C_BIGENDIAN(OS_FLAGS="${OS_FLAGS} -D_BIG_ENDIAN")
 
 AC_SUBST(OPT_FLAGS)
 AC_SUBST(OS_FLAGS)
-- 
GitLab