Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into std-mutex1
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Feb 5, 2024
2 parents fa95dbf + dd14cad commit b8be90e
Show file tree
Hide file tree
Showing 96 changed files with 670 additions and 761 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN set -eux \
&& sudo dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& sudo apt update \
&& sudo apt-get install -y python3 ruby-full \
&& sudo apt-get install -y python3 python3-dev python3-passlib ruby-full \
&& sudo apt-get install -y libbluetooth-dev libbz2-dev libdbus-1-dev libedit-dev libexpat1-dev liblmdb-dev libmcpp-dev libssl-dev libsystemd-dev \
&& sudo rm -rf /var/lib/apt/lists/* \
&& sudo apt-get clean
40 changes: 3 additions & 37 deletions CHANGELOG-3.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,13 @@ Ice 3.7. You can still define proxies with the usual syntax, `Greeter*`, where `

## C++ Changes

- The C++98 mapping is now called the Original mapping.

- The C++11 mapping is now called the New mapping.

- (Original mapping) The base class for mapped class instances is now Ice::Value, like in the new mapping. Previously,
Ice::Object was the base class for both mapped class instances and servants.

- (Original mapping) Ice::Value does not derive from IceUtil::Shared and the generated Ptr for mapped classed is now an
Ice::SharedPtr that behaves mostly like the previous IceUtil (and IceInternal) Handle by wrapping a std::shared_ptr.
The important differences are:
- the comparison operators of Ice::SharedPtr compare pointers like std::shared_ptr but unlike IceUtil::Handle.
- the pointed-to object no longer holds the reference count, and as result you must be careful and avoid creating
multiple SharedPtr managing the same object. For example:
```
MyClassPtr c1 = new MyClass(); // SharedPtr to class instance
MyClassPtr c2 = c1; // c1 and c2 point to the same instance
MyClassPtr c3 = c1.get(); // c3 points to the same instance. With Ice 3.7 and before, it's ok as it simply adds a
// a reference count to the shared instance. As of Ice 3.8, it's incorrect since c3 is a new
// independent SharedPtr with its own reference count.
```

- (Original mapping) Removed all support for garbage collection (GC) of class instances. If you create or receive a
graph of class instances with a cycle, you must break this cycle to avoid a leak.

- (New mapping) Ice::optional is now an alias for std::optional.

- (Original mapping) IceUtil::Optional is now an alias for std::optional. When upgrading from Ice 3.7 or earlier, you
need to replace calls to `get()` on IceUtil::Optional by calls to `value()`.
- There is now a single C++ mapping, based on the C++11 mapping provided by Ice 3.7. This new C++ mapping requires a
C++ compiler with support for std=c++17 or higher.

## Objective-C Changes

- The base class for class instances is now Ice::Value. Previously, Ice::Object was the base class for both mapped class
instances and servants.

- The slice compiler no longer generates an Objective-C protocol for Slice classes. It generates only an Objective-C
class (interface).
- The Objective-C mapping was removed.

## PHP Changes

- Removed the flattened mapping deprecated in 3.7.

## Ice Service Changes

- The implementations of Glacier2, IceGrid, IceStorm and IcePatch2 were updated to use the new C++ mapping.
2 changes: 1 addition & 1 deletion config/Make.project.rules
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ $3/%.o: $1/%.mm
$3/%.o: $1/%.mm
$(E) "Compiling [$8-$9] $$<"
$(Q)$(or $($8_cxx),$(platform_cxx)) $(CXXFLAGS) $(call depend-cppflags,$3/$$*.Td,$$@)\
$(strip $6) $(CPPFLAGS) -std=c++17 -c $$< -o $$@
$(strip $6) $(CPPFLAGS) -c $$< -o $$@
$(Q)$(MV) $3/$$*.Td $3/$$*.mm.d
endif

Expand Down
10 changes: 7 additions & 3 deletions config/Make.rules.Darwin
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ ifeq ($(MAXWARN),yes)
cppflags += -Wweak-vtables
endif

# -Wshadow issues false warnings with clang 3.x (Apple LLVM 9.0)
ifeq ($(shell clang -v 2>&1 | sed -ne 's/.*version \([0-9]*\)\.\([0-9]*\).*/\1\2/p'),90)
cppflags := $(filter-out -Wshadow -Wshadow-all,$(cppflags))
clang_version = $(shell clang -dumpversion 2>&1 | cut -f1 -d\.)

# We use -std=c++20 with clang 15.0 and later.
ifeq ($(shell test $(clang_version) -ge 15 && echo yes),yes)
cppflags += -std=c++20
else
cppflags += -std=c++17
endif

nodeprecatedwarnings-cppflags := -Wno-deprecated-declarations
Expand Down
8 changes: 4 additions & 4 deletions config/Make.rules.Linux
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ shared_ldflags = $(if $(filter-out program,$($1_target)),\
cppflags = -Wall -Wextra -Wredundant-decls -Wshadow -Wdeprecated -Werror -pthread $(if $(filter yes,$(OPTIMIZE)),-DNDEBUG,-g)
ldflags = -pthread

# -Wshadow is too strict with gcc 4
ifeq ($(shell $(CXX) -dumpversion | cut -f1 -d\.),4)
cppflags := $(filter-out -Wshadow,$(cppflags))
endif
gcc_version = $(shell $(CXX) -dumpversion 2>&1 | cut -f1 -d\.)

# As of GCC 13.4, https://gcc.gnu.org/projects/cxx-status.html#cxx20 still describes C++20 support as "experimental".
cppflags += -std=c++17

nodeprecatedwarnings-cppflags := -Wno-deprecated-declarations
nounusedparameter-cppflags := -Wno-unused-parameter
Expand Down
5 changes: 1 addition & 4 deletions cpp/config/Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ ifeq ($(os),Darwin)
include $(lang_srcdir)/config/Make.xcodesdk.rules
endif

# We assume Make.rules.$(os) defines cppflags.
cppflags += -std=c++17

# Validate platforms and configs
$(eval $(call validate-config))

Expand Down Expand Up @@ -78,7 +75,7 @@ define make-cpp-src-project
ifeq ($(filter all cpp,$(ICE_BIN_DIST)),)
$1_slicecompiler := slice2cpp
$1_sliceflags += -I$(slicedir)
$1_cppflags += -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC -std=c++17
$1_cppflags += -Isrc -I$1/generated -I$(includedir) -I$(includedir)/generated -DICE_BUILDING_SRC
$(make-project)
srcs:: $1
endif
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <Ice/Incoming.h>
#include <Ice/IncomingAsync.h>
#include <Ice/FactoryTableInit.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/ExceptionHelpers.h>
#include <Ice/LoggerF.h>
#include <Ice/InstrumentationF.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/CommunicatorF.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/Ice/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/OutgoingAsync.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/ObjectAdapterF.h>
#include <Ice/Identity.h>
#include <Ice/Endpoint.h>
Expand Down Expand Up @@ -409,7 +409,7 @@ class ICE_CLASS(ICE_API) Connection
* @param close The close condition
* @param heartbeat The hertbeat condition
*/
virtual void setACM(const Ice::optional<int>& timeout, const Ice::optional<ACMClose>& close, const Ice::optional<ACMHeartbeat>& heartbeat) = 0;
virtual void setACM(const std::optional<int>& timeout, const std::optional<ACMClose>& close, const std::optional<ACMHeartbeat>& heartbeat) = 0;

/**
* Get the ACM parameters.
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/ConnectionF.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Current.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/ObjectAdapterF.h>
#include <Ice/ConnectionF.h>
#include <Ice/Context.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/Version.h>
#include <Ice/BuiltinSequences.h>
#include <Ice/EndpointF.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/EndpointF.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/EndpointSelectionType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Ice.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/Proxy.h>
#include <Ice/Current.h>
#include <Ice/LocalException.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/Object.h>
#include <Ice/SlicedData.h>
#include <Ice/OutgoingAsync.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/ImplicitContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/ExceptionHelpers.h>
#include <Ice/LocalException.h>
#include <Ice/Current.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/ImplicitContextF.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

namespace Ice
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/Ice/InputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ class ICE_API InputStream : public IceInternal::Buffer
* @param tag The tag ID.
* @param v Holds the extracted data (if any).
*/
template<typename T> void read(Int tag, IceUtil::Optional<T>& v)
template<typename T> void read(Int tag, std::optional<T>& v)
{
if(readOptional(tag, StreamOptionalHelper<T,
StreamableTraits<T>::helper,
Expand All @@ -645,7 +645,7 @@ class ICE_API InputStream : public IceInternal::Buffer
}
else
{
v = IceUtil::None;
v = std::nullopt;
}
}

Expand Down Expand Up @@ -691,7 +691,7 @@ class ICE_API InputStream : public IceInternal::Buffer
* Reads a list of optional data values.
*/
template<typename T>
void readAll(std::initializer_list<int> tags, IceUtil::Optional<T>& v)
void readAll(std::initializer_list<int> tags, std::optional<T>& v)
{
read(*(tags.begin() + tags.size() - 1), v);
}
Expand All @@ -700,7 +700,7 @@ class ICE_API InputStream : public IceInternal::Buffer
* Reads a list of optional data values.
*/
template<typename T, typename... Te>
void readAll(std::initializer_list<int> tags, IceUtil::Optional<T>& v, IceUtil::Optional<Te>&... ve)
void readAll(std::initializer_list<int> tags, std::optional<T>& v, std::optional<Te>&... ve)
{
size_t index = tags.size() - sizeof...(ve) - 1;
read(*(tags.begin() + index), v);
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/LocalException.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/ExceptionHelpers.h>
#include <Ice/Identity.h>
#include <Ice/Version.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/LoggerF.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <IceUtil/UndefSysMacros.h>

#ifndef ICE_API
Expand Down
66 changes: 0 additions & 66 deletions cpp/include/Ice/Optional.h

This file was deleted.

6 changes: 3 additions & 3 deletions cpp/include/Ice/OutputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class ICE_API OutputStream : public IceInternal::Buffer
* @param tag The tag ID.
* @param v The data value to be written (if any).
*/
template<typename T> void write(Int tag, const IceUtil::Optional<T>& v)
template<typename T> void write(Int tag, const std::optional<T>& v)
{
if(!v)
{
Expand Down Expand Up @@ -489,7 +489,7 @@ class ICE_API OutputStream : public IceInternal::Buffer
* Writes a list of optional data values.
*/
template<typename T>
void writeAll(std::initializer_list<int> tags, const IceUtil::Optional<T>& v)
void writeAll(std::initializer_list<int> tags, const std::optional<T>& v)
{
write(*(tags.begin() + tags.size() - 1), v);
}
Expand All @@ -498,7 +498,7 @@ class ICE_API OutputStream : public IceInternal::Buffer
* Writes a list of optional data values.
*/
template<typename T, typename... Te>
void writeAll(std::initializer_list<int> tags, const IceUtil::Optional<T>& v, const IceUtil::Optional<Te>&... ve)
void writeAll(std::initializer_list<int> tags, const std::optional<T>& v, const std::optional<Te>&... ve)
{
size_t index = tags.size() - sizeof...(ve) - 1;
write(*(tags.begin() + index), v);
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <Ice/LocalObject.h>
#include <Ice/StreamHelpers.h>
#include <Ice/Comparable.h>
#include <Ice/Optional.h>
#include <optional>
#include <Ice/LoggerF.h>
#include <Ice/BuiltinSequences.h>
#include <IceUtil/UndefSysMacros.h>
Expand Down
Loading

0 comments on commit b8be90e

Please sign in to comment.