mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-04 02:34:06 +00:00
Fix build error on some platforms
This commit is contained in:
1 file changed
+4
-4
+4
-4
@@ -19,11 +19,11 @@
|
|||||||
#define PATH_SLASH "//"
|
#define PATH_SLASH "//"
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#define concat(a,b) a ## b
|
#define CONCAT(a,b) a ## b
|
||||||
#define do_concat(a,b) concat(a,b)
|
#define DO_CONCAT(a,b) CONCAT(a,b)
|
||||||
template <typename T> class __defer_struct final {private: T fn; bool __cancelled = false; public: __defer_struct(T func) : fn(std::move(func)) {} ~__defer_struct() {if(!__cancelled) fn();} void cancel() {__cancelled = true;} };
|
template <typename T> class __defer_struct final {private: T fn; bool __cancelled = false; public: __defer_struct(T func) : fn(std::move(func)) {} ~__defer_struct() {if(!__cancelled) fn();} void cancel() {__cancelled = true;} };
|
||||||
//#define defer(x) std::unique_ptr<void> do_concat(__defer_deleter_,__LINE__) (nullptr, [&](...){x});
|
//#define defer(x) std::unique_ptr<void> DO_CONCAT(__defer_deleter_,__LINE__) (nullptr, [&](...){x});
|
||||||
#define defer(x) __defer_struct do_concat(__defer_deleter,__COUNTER__) ([&](...){x;});
|
#define defer(x) __defer_struct DO_CONCAT(__defer_deleter,__COUNTER__) ([&](...){x;});
|
||||||
|
|
||||||
typedef std::string::size_type string_size;
|
typedef std::string::size_type string_size;
|
||||||
typedef std::vector<std::string> string_array;
|
typedef std::vector<std::string> string_array;
|
||||||
|
|||||||
Reference in new issue
Block a user