Skip to content

Commit

Permalink
MWC: make Dummy function placeholders callable to fix build with MSVC (
Browse files Browse the repository at this point in the history
…#361)

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
  • Loading branch information
678098 authored Jul 19, 2024
1 parent 99e8aff commit c26c558
Show file tree
Hide file tree
Showing 5 changed files with 368 additions and 425 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ settings.json
.pytest_cache/
.cache/
.venv/

# Symlink from 'src/applications/bmqbrkr/run'
src/applications/bmqbrkr/etc/etc

# 'sim_cpp11_features.pl' backups
*.bak
11 changes: 10 additions & 1 deletion src/groups/mwc/mwcex/mwcex_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
//..

// MWC

#include <mwcex_executortraits.h>

// BDE
Expand Down Expand Up @@ -295,6 +294,16 @@ class Executor_Box_SboImp {
/// size of the on-stack buffer used to store the executor target.
struct Dummy {
void* d_padding[4];

bool operator==(const Dummy&) const BSLS_KEYWORD_NOEXCEPT
{
return false;
}

void post(const bsl::function<void()>&) const
{
// NOTHING
}
};

private:
Expand Down
8 changes: 4 additions & 4 deletions src/groups/mwc/mwcex/mwcex_future.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
// result-supplier thread.

// MWC

#include <mwcu_objectplaceholder.h>

// BDE
#include <bdlb_nullablevalue.h>
#include <bdlf_noop.h>
#include <bsl_algorithm.h> // bsl::swap
#include <bsl_exception.h>
#include <bsl_functional.h> // bsl::reference_wrapper
Expand Down Expand Up @@ -150,7 +150,7 @@

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

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

Expand Down Expand Up @@ -359,7 +359,7 @@ class Future_Callback {

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

Expand Down
Loading

0 comments on commit c26c558

Please sign in to comment.