summarylogtreecommitdiffstats
path: root/0001-Replace-deprecated-Boost-header-in-admesh.patch
blob: bea239bfadcb6c4ceb69480c4a6a3f60bb5c53f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 3a194f91871684b5fc8c6c78300b87e0ee1cb610 Mon Sep 17 00:00:00 2001
From: Megidd <megiddgit@gmail.com>
Date: Mon, 21 Sep 2020 18:00:52 +0330
Subject: [PATCH] Replace deprecated Boost header in "admesh"

---
 src/admesh/stlinit.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/admesh/stlinit.cpp b/src/admesh/stlinit.cpp
index 390fe56a4..6aa2c4417 100644
--- a/src/admesh/stlinit.cpp
+++ b/src/admesh/stlinit.cpp
@@ -28,7 +28,7 @@
 
 #include <boost/log/trivial.hpp>
 #include <boost/nowide/cstdio.hpp>
-#include <boost/detail/endian.hpp>
+#include <boost/predef/other/endian.h>
 
 #include "stl.h"
 
@@ -36,9 +36,9 @@
 #error "SEEK_SET not defined"
 #endif
 
-#ifndef BOOST_LITTLE_ENDIAN
+#if BOOST_ENDIAN_BIG_BYTE
 extern void stl_internal_reverse_quads(char *buf, size_t cnt);
-#endif /* BOOST_LITTLE_ENDIAN */
+#endif /* BOOST_ENDIAN_BIG_BYTE */
 
 static FILE* stl_open_count_facets(stl_file *stl, const char *file) 
 {
@@ -89,10 +89,10 @@ static FILE* stl_open_count_facets(stl_file *stl, const char *file)
     	// Read the int following the header.  This should contain # of facets.
 	  	uint32_t header_num_facets;
     	bool header_num_faces_read = fread(&header_num_facets, sizeof(uint32_t), 1, fp) != 0;
-#ifndef BOOST_LITTLE_ENDIAN
+#if BOOST_ENDIAN_BIG_BYTE
     	// Convert from little endian to big endian.
     	stl_internal_reverse_quads((char*)&header_num_facets, 4);
-#endif /* BOOST_LITTLE_ENDIAN */
+#endif /* BOOST_ENDIAN_BIG_BYTE */
     	if (! header_num_faces_read || num_facets != header_num_facets)
 			BOOST_LOG_TRIVIAL(info) << "stl_open_count_facets: Warning: File size doesn't match number of facets in the header: " << file;
   	}
@@ -158,10 +158,10 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first)
       		// Read a single facet from a binary .STL file. We assume little-endian architecture!
       		if (fread(&facet, 1, SIZEOF_STL_FACET, fp) != SIZEOF_STL_FACET)
       			return false;
-#ifndef BOOST_LITTLE_ENDIAN
+#if BOOST_ENDIAN_BIG_BYTE
       		// Convert the loaded little endian data to big endian.
       		stl_internal_reverse_quads((char*)&facet, 48);
-#endif /* BOOST_LITTLE_ENDIAN */
+#endif /* BOOST_ENDIAN_BIG_BYTE */
     	} else {
 			// Read a single facet from an ASCII .STL file
 			// skip solid/endsolid
-- 
2.29.2