Skip to content

Commit af97435

Browse files
678098alexander-e1off
authored andcommitted
MWC: make Dummy function placeholders callable to fix build with MSVC (bloomberg#361)
Signed-off-by: Evgeny Malygin <[email protected]>
1 parent 803ee62 commit af97435

File tree

5 files changed

+368
-425
lines changed

5 files changed

+368
-425
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ settings.json
2626
.pytest_cache/
2727
.cache/
2828
.venv/
29+
30+
# Symlink from 'src/applications/bmqbrkr/run'
31+
src/applications/bmqbrkr/etc/etc
32+
33+
# 'sim_cpp11_features.pl' backups
34+
*.bak

src/groups/mwc/mwcex/mwcex_executor.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
//..
106106

107107
// MWC
108-
109108
#include <mwcex_executortraits.h>
110109

111110
// BDE
@@ -295,6 +294,16 @@ class Executor_Box_SboImp {
295294
/// size of the on-stack buffer used to store the executor target.
296295
struct Dummy {
297296
void* d_padding[4];
297+
298+
bool operator==(const Dummy&) const BSLS_KEYWORD_NOEXCEPT
299+
{
300+
return false;
301+
}
302+
303+
void post(const bsl::function<void()>&) const
304+
{
305+
// NOTHING
306+
}
298307
};
299308

300309
private:

src/groups/mwc/mwcex/mwcex_future.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@
113113
// result-supplier thread.
114114

115115
// MWC
116-
117116
#include <mwcu_objectplaceholder.h>
118117

119118
// BDE
120119
#include <bdlb_nullablevalue.h>
120+
#include <bdlf_noop.h>
121121
#include <bsl_algorithm.h> // bsl::swap
122122
#include <bsl_exception.h>
123123
#include <bsl_functional.h> // bsl::reference_wrapper
@@ -150,7 +150,7 @@
150150

151151
#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
152152
// Include version that can be compiled with C++03
153-
// Generated on Wed Jun 29 04:17:13 2022
153+
// Generated on Wed Jul 17 12:44:45 2024
154154
// Command line: sim_cpp11_features.pl mwcex_future.h
155155
#define COMPILING_MWCEX_FUTURE_H
156156
#include <mwcex_future_cpp03.h>
@@ -232,7 +232,7 @@ class Future_Exception {
232232

233233
/// Provides a "small" dummy object which size is used to calculate the
234234
/// size of the on-stack buffer used for optimization.
235-
struct Dummy {
235+
struct Dummy : public bdlf::NoOp {
236236
void* d_padding[3];
237237
};
238238

@@ -359,7 +359,7 @@ class Future_Callback {
359359

360360
/// Provides a "small" dummy object which size is used to calculate the
361361
/// size of the on-stack buffer used for optimization.
362-
struct Dummy {
362+
struct Dummy : public bdlf::NoOp {
363363
void* d_padding[3];
364364
};
365365

0 commit comments

Comments
 (0)