Skip to content

Commit

Permalink
Fix build failures
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Mar 14, 2024
1 parent 56e383d commit fb4e6f2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 48 deletions.
35 changes: 18 additions & 17 deletions cpp/include/IceBT/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#ifndef __IceBT_Types_h__
#define __IceBT_Types_h__
#ifndef ICE_BT_TYPES_H
#define ICE_BT_TYPES_H

#include <IceUtil/PushDisableWarnings.h>
#include <Ice/ProxyF.h>
#include <Ice/ObjectF.h>
#include <Ice/ValueF.h>
#include <Ice/Exception.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <optional>
#include <Ice/ExceptionHelpers.h>
#include <IceUtil/UndefSysMacros.h>
#include "Ice/LocalException.h"

#ifndef ICEBT_API
# if defined(ICE_STATIC_LIBS)
Expand All @@ -26,6 +17,14 @@
# endif
#endif

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wshadow-field-in-constructor"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wshadow"
#endif

namespace IceBT
{
/**
Expand Down Expand Up @@ -61,10 +60,7 @@ namespace IceBT
* @return The fully-scoped type ID.
*/
static ::std::string_view ice_staticId() noexcept;
/**
* Prints this exception to the given stream.
* @param stream The target stream.
*/

void ice_print(std::ostream& stream) const override;

std::string ice_id() const override;
Expand All @@ -78,5 +74,10 @@ namespace IceBT
};
}

#include <IceUtil/PopDisableWarnings.h>
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#endif

#endif
7 changes: 6 additions & 1 deletion cpp/src/IceUtil/UtilException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,12 @@ namespace

IceUtil::Exception::Exception() noexcept : _file(0), _line(0), _stackFrames(getStackFrames()) {}

IceUtil::Exception::Exception(const char* file, int line) noexcept : _file(file), _line(line), _stackFrames(getStackFrames()) {}
IceUtil::Exception::Exception(const char* file, int line) noexcept
: _file(file),
_line(line),
_stackFrames(getStackFrames())
{
}

void
IceUtil::Exception::ice_print(ostream& out) const
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/Ice/background/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ class TEST_API Configuration : public std::enable_shared_from_this<Configuration
std::exception_ptr _connectException;
IceInternal::SocketOperation _initializeSocketOperation;
int _initializeResetCount;
std::exception_ptr _initializeException;
std::exception_ptr _initializeException;
int _readReadyCount;
std::exception_ptr _readException;
std::exception_ptr _readException;
int _writeReadyCount;
std::exception_ptr _writeException;
std::exception_ptr _writeException;
bool _buffered;
std::mutex _mutex;
static ConfigurationPtr _instance;
Expand Down
3 changes: 2 additions & 1 deletion cpp/test/Ice/background/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ BackgroundControllerI::initializeSocketOperation(int status, const Current&)
void
BackgroundControllerI::initializeException(bool enable, const Current&)
{
_configuration->initializeException(enable ? make_exception_ptr(SocketException(__FILE__, __LINE__)) : exception_ptr{});
_configuration->initializeException(
enable ? make_exception_ptr(SocketException(__FILE__, __LINE__)) : exception_ptr{});
}

void
Expand Down
5 changes: 1 addition & 4 deletions python/modules/IcePy/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,7 @@ extern "C"
cancel = (*self->communicator)
->flushBatchRequestsAsync(
compress,
[callback](exception_ptr ex)
{
callback->exception(ex);
},
[callback](exception_ptr ex) { callback->exception(ex); },
[callback](bool sentSynchronously) { callback->sent(sentSynchronously); });
}
catch (...)
Expand Down
5 changes: 1 addition & 4 deletions python/modules/IcePy/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,7 @@ extern "C"
cancel = (*self->connection)
->flushBatchRequestsAsync(
compress,
[callback](exception_ptr ex)
{
callback->exception(ex);
},
[callback](exception_ptr ex) { callback->exception(ex); },
[callback](bool sentSynchronously) { callback->sent(sentSynchronously); });
}
catch (...)
Expand Down
14 changes: 4 additions & 10 deletions python/modules/IcePy/Operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ extern "C"
auto callbackWrapper = make_shared<CallbackWrapper>(callback);
(*self->communicator)->postToClientThreadPool([callbackWrapper]() { callbackWrapper->run(); });
}
catch (const Ice::CommunicatorDestroyedException& ex)
catch (const Ice::CommunicatorDestroyedException&)
{
setPythonException(current_exception());
return 0;
Expand Down Expand Up @@ -1825,7 +1825,7 @@ IcePy::AsyncInvocation::invoke(PyObject* args, PyObject* kwds)
//
// TwowayOnlyException can propagate directly.
//
setPythonException(current_exception());
setPythonException(current_exception());
return 0;
}
catch (...)
Expand Down Expand Up @@ -2092,10 +2092,7 @@ IcePy::AsyncTypedInvocation::handleInvoke(PyObject* args, PyObject* /* kwds */)
_op->sendMode,
params,
[self](bool ok, const pair<const byte*, const byte*>& results) { self->response(ok, results); },
[self](exception_ptr ex)
{
self->exception(ex);
},
[self](exception_ptr ex) { self->exception(ex); },
[self](bool sentSynchronously) { self->sent(sentSynchronously); },
pyctx == Py_None ? Ice::noExplicitContext : context);
}
Expand Down Expand Up @@ -2313,10 +2310,7 @@ IcePy::AsyncBlobjectInvocation::handleInvoke(PyObject* args, PyObject* /* kwds *
sendMode,
params,
[self](bool ok, const pair<const byte*, const byte*>& results) { self->response(ok, results); },
[self](exception_ptr ex)
{
self->exception(ex);
},
[self](exception_ptr ex) { self->exception(ex); },
[self](bool sentSynchronously) { self->sent(sentSynchronously); },
(ctx == 0 || ctx == Py_None) ? Ice::noExplicitContext : context);
}
Expand Down
10 changes: 2 additions & 8 deletions python/modules/IcePy/Proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1763,10 +1763,7 @@ extern "C"
cancel = (*self->proxy)
->ice_getConnectionAsync(
[callback](const Ice::ConnectionPtr& connection) { callback->response(connection); },
[callback](exception_ptr ex)
{
callback->exception(ex);
});
[callback](exception_ptr ex) { callback->exception(ex); });
}
catch (...)
{
Expand Down Expand Up @@ -1857,10 +1854,7 @@ extern "C"
{
cancel = (*self->proxy)
->ice_flushBatchRequestsAsync(
[callback](exception_ptr ex)
{
callback->exception(ex);
},
[callback](exception_ptr ex) { callback->exception(ex); },
[callback](bool sentSynchronously) { callback->sent(sentSynchronously); });
}
catch (...)
Expand Down

0 comments on commit fb4e6f2

Please sign in to comment.