Skip to content

Commit

Permalink
misc(coro): deprecate sync methods when DPP_CORO is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Aug 26, 2023
1 parent 957b282 commit e0f1bd9
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 193 deletions.
2 changes: 1 addition & 1 deletion buildtools/classes/Generator/SyncGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function checkForChanges(): bool
*/
public function generateHeaderDef(string $returnType, string $currentFunction, string $parameters, string $noDefaults, string $parameterTypes, string $parameterNames): string
{
return "$returnType {$currentFunction}_sync($parameters);\n\n";
return "DPP_DEPRECATED_WITH_CORO $returnType {$currentFunction}_sync($parameters);\n\n";
}

/**
Expand Down
376 changes: 188 additions & 188 deletions include/dpp/cluster_sync_calls.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/dpp/coro.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*
************************************************************************************/

#ifdef DPP_CORO
#pragma once
#ifdef DPP_CORO

#include "coro/async.h"
#include "coro/coroutine.h"
Expand Down
8 changes: 7 additions & 1 deletion include/dpp/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@
#define SOCKET int
#else
#include <WinSock2.h>
#endif
#endif

#ifdef DPP_CORO
#define DPP_DEPRECATED_WITH_CORO [[deprecated("sync methods are deprecated and will be removed in a future version. use coro methods instead")]]
#else
#define DPP_DEPRECATED_WITH_CORO
#endif
2 changes: 1 addition & 1 deletion library-vcpkg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ target_compile_definitions(

target_compile_options(
"${LIB_NAME}" PUBLIC
"$<$<PLATFORM_ID:Windows>:/bigobj>"
"$<$<PLATFORM_ID:Windows>:/bigobj;/w34996>"
"$<$<PLATFORM_ID:Windows>:$<$<CONFIG:Debug>:/sdl;/std:c++17;/Od;/DEBUG;/sdl;/MP;/DFD_SETSIZE=1024;/Zc:preprocessor>>"
"$<$<PLATFORM_ID:Windows>:$<$<CONFIG:Release>:/std:c++17;/O2;/Oi;/Oy;/GL;/Gy;/sdl;/MP;/DFD_SETSIZE=1024;/Zc:preprocessor>>"
"$<$<PLATFORM_ID:Linux>:$<$<CONFIG:Debug>:-std=c++17;-Wall;-Wempty-body;-Wno-psabi;-Wunknown-pragmas;-Wignored-qualifiers;-Wimplicit-fallthrough;-Wmissing-field-initializers;-Wsign-compare;-Wtype-limits;-Wuninitialized;-Wshift-negative-value;-pthread;-g;-Og;-fPIC>>"
Expand Down
2 changes: 1 addition & 1 deletion library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ if(UNIX OR MSYS)
endif()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /sdl /DFD_SETSIZE=1024")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /sdl /DFD_SETSIZE=1024 /w34996")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /Od /DEBUG /Zi")
else()
Expand Down

0 comments on commit e0f1bd9

Please sign in to comment.