summaryrefslogtreecommitdiff
path: root/media-gfx/slic3r/files/boost-io-context-1.3.0.patch
blob: 12335d94589cb5cf2cb1d575e42dfb9087eadbd2 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
From eff78b92512cfe89675f2efd768ddacb2e93ec62 Mon Sep 17 00:00:00 2001
From: bakedsnake <bakedsnake@vagrantz.xyz>
Date: Mon, 24 Aug 2026 15:59:05 +0200
Subject: [PATCH] Updates deprecated `asio::io_service` with `asio::io_context`

Thought I would leave this here  for  documentation
purposes at least. This  makes  the  latest version
able    to    build.    (    latest    commit    ).
---

--- a/src/libslic3r/GCodeSender.cpp
+++ b/src/libslic3r/GCodeSender.cpp
@@ -35,7 +35,9 @@ struct termios2 {
 	speed_t c_ispeed;
 	speed_t c_ospeed;
 };
+#ifndef BOTHER
 #define BOTHER CBAUDEX
+#endif
 
 #endif
 
@@ -97,12 +99,12 @@ GCodeSender::connect(std::string devname, unsigned int baud_rate)
     fs.open("serial.txt", std::fstream::out | std::fstream::trunc);
 #endif
     
-    // this gives some work to the io_service before it is started
+    // this gives some work to the io_context before it is started
     // (post() runs the supplied function in its thread)
-    this->io.post(boost::bind(&GCodeSender::do_read, this));
+    boost::asio::post(this->io, boost::bind(&GCodeSender::do_read, this));
     
     // start reading in the background thread
-    boost::thread t(boost::bind(&asio::io_service::run, &this->io));
+    boost::thread t(boost::bind(&asio::io_context::run, &this->io));
     this->background_thread.swap(t);
     
     // always send a M105 to check for connection because firmware might be silent on connect 
@@ -159,9 +161,8 @@ GCodeSender::disconnect()
     if (!this->open) return;
     this->open = false;
     this->connected = false;
-    this->io.post(boost::bind(&GCodeSender::do_close, this));
+    boost::asio::post(this->io, boost::bind(&GCodeSender::do_close, this));
     this->background_thread.join();
-    this->io.reset();
     /*
     if (this->error_status()) {
         throw(boost::system::system_error(boost::system::error_code(),
@@ -444,7 +445,7 @@ GCodeSender::send(const std::string &line, bool priority)
 void
 GCodeSender::send()
 {
-    this->io.post(boost::bind(&GCodeSender::do_send, this));
+    boost::asio::post(this->io, boost::bind(&GCodeSender::do_send, this));
 }
 
 void
--- a/src/libslic3r/GCodeSender.hpp
+++ b/src/libslic3r/GCodeSender.hpp
@@ -47,7 +47,7 @@ class GCodeSender : private boost::noncopyable {
     void reset();
     
     private:
-    asio::io_service io;
+    asio::io_context io;
     asio::serial_port serial;
     boost::thread background_thread;
     boost::asio::streambuf read_buffer, write_buffer;

From: bakedsnake <bakedsnake@vagrantz.xyz>
Date: Mon, 24 Aug 2026 15:59:05 +0200
Subject: [PATCH] add missing boost noncopyable
--- a/src/libslic3r/GCodeSender.hpp
+++ b/src/libslic3r/GCodeSender.hpp
@@ -8,6 +8,7 @@
 #include <vector>
 #include <boost/asio.hpp>
 #include <boost/bind.hpp>
+#include <boost/core/noncopyable.hpp>
 #include <boost/thread.hpp>
 
 namespace Slic3r {
From d5084db14e7b4e75bf588fe063a5b9941c1cac31 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@redhat.com>
Date: Wed, 3 Jun 2020 01:05:39 +0200
Subject: [PATCH 01/15] Make boost::Placeholders::_1 visible

Fixes https://github.com/slic3r/Slic3r/issues/4967
---

--- a/src/libslic3r/GCodeTimeEstimator.cpp
+++ b/src/libslic3r/GCodeTimeEstimator.cpp
@@ -1,9 +1,12 @@
 #include "GCodeTimeEstimator.hpp"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
 #include <cmath>
 
 namespace Slic3r {
 
+using boost::placeholders::_1;
+using boost::placeholders::_2;
+
 void
 GCodeTimeEstimator::parse(const std::string &gcode)
 {

--- a/src/libslic3r/SLAPrint.cpp
+++ b/src/libslic3r/SLAPrint.cpp
@@ -7,9 +7,12 @@
 #include <iostream>
 #include <complex>
 #include <cstdio>
+#include <boost/bind/bind.hpp>
 
 namespace Slic3r {
 
+using boost::placeholders::_1;
+
 void
 SLAPrint::slice()
 {
--- a/src/libslic3r/TriangleMesh.cpp
+++ b/src/libslic3r/TriangleMesh.cpp
@@ -15,6 +15,7 @@
 #include <stdexcept>
 #include <boost/config.hpp>
 #include <boost/nowide/convert.hpp>
+#include <boost/bind/bind.hpp>
 
 #ifdef SLIC3R_DEBUG
 #include "SVG.hpp"
@@ -22,6 +23,8 @@
 
 namespace Slic3r {
 
+using boost::placeholders::_1;
+
 TriangleMesh::TriangleMesh()
     : repaired(false)
 {
--- a/src/libslic3r/PrintObject.cpp
+++ b/src/libslic3r/PrintObject.cpp
@@ -4,6 +4,9 @@
 #include "Geometry.hpp"
 #include <algorithm>
 #include <vector>
+#include <boost/bind/bind.hpp>
+
+using boost::placeholders::_1;

 namespace Slic3r {

--- a/Build.PL
+++ b/Build.PL
@@ -142,7 +142,7 @@ if (defined $ENV{BOOST_LIBRARYPATH}) {
 }
 # In order to generate the -l switches we need to know how Boost libraries are named
 my $have_boost = 0;
-my @boost_libraries = qw(system thread filesystem);  # we need these
+my @boost_libraries = qw(thread filesystem);  # we need these
 # check without explicit lib path (works on Linux)
 if (! $mswin) {
     $have_boost = 1