Skip to content

Commit

Permalink
Vutils
Browse files Browse the repository at this point in the history
  • Loading branch information
vic4key committed Nov 11, 2023
1 parent ae63e43 commit ab0f1d9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

/* MinGW build EXE with static library
G++ main.cpp -std=c++0x -lVutils -lgdi32 -lole32 -lcomdlg32 -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -lVutils -DVU_INET_ENABLED -DVU_GUID_ENABLED -DVU_WMI_ENABLED -lws2_32 -lgdi32 -lrpcrt4 -lole32 -loleaut32 -lwbemuuid -lcomdlg32 -lwinhttp -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -fpermissive -lVutils -lgdi32 -lole32 -lcomdlg32 -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -fpermissive -lVutils -DVU_INET_ENABLED -DVU_GUID_ENABLED -DVU_WMI_ENABLED -lws2_32 -lgdi32 -lrpcrt4 -lole32 -loleaut32 -lwbemuuid -lcomdlg32 -lwinhttp -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -municode -lVutils -DUNICODE -D_UNICODE -lgdi32 -lole32 -lcomdlg32 -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -municode -lVutils -DUNICODE -D_UNICODE -DVU_INET_ENABLED -DVU_GUID_ENABLED -DVU_WMI_ENABLED -lws2_32 -lgdi32 -lrpcrt4 -lole32 -loleaut32 -lwbemuuid -lcomdlg32 -lwinhttp -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -fpermissive -municode -lVutils -DUNICODE -D_UNICODE -lgdi32 -lole32 -lcomdlg32 -o Test.exe && Test.exe
G++ main.cpp -std=c++0x -fpermissive -municode -lVutils -DUNICODE -D_UNICODE -DVU_INET_ENABLED -DVU_GUID_ENABLED -DVU_WMI_ENABLED -lws2_32 -lgdi32 -lrpcrt4 -lole32 -loleaut32 -lwbemuuid -lcomdlg32 -lwinhttp -o Test.exe && Test.exe
*/

Expand Down
4 changes: 2 additions & 2 deletions include/Vutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3337,12 +3337,12 @@ class ThreadPool
*/

// C++14 (MSVC 2015+ or MinGW 5.1+)
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(__MINGW32__) && __cplusplus >= 201402L)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201402L)
#include "template/handle.tpl"
ScopedHandleT_Define(HANDLE, HANDLE, INVALID_HANDLE_VALUE, { CloseHandle(h); });
ScopedHandleT_Define(NULL_HANDLE, HANDLE, nullptr, { CloseHandle(h); });
ScopedHandleT_Define(FILE, FILE*, nullptr, { fclose(h); });
#endif
#endif // C++14 (MSVC 2015+ or MinGW 5.1+)

/**
* Path
Expand Down
2 changes: 1 addition & 1 deletion include/template/easyprint.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once

// C++14 (MSVC 2015+ or MinGW 5.1+)
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(__MINGW32__) && __cplusplus >= 201402L)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201402L)

#define EASY_PRINT_WINDOWS

Expand Down
9 changes: 6 additions & 3 deletions include/template/handle.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* @brief Template for Scoped Handle
*/

/**
* ScopedHandleT
*/
// C++14 (MSVC 2015+ or MinGW 5.1+)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201402L)

template<typename traits>
class ScopedHandleT
Expand Down Expand Up @@ -73,3 +72,7 @@ struct _deleter_ ## object_name\
static void close(type h) { oneliner_codes; }\
};\
using Scoped_ ## object_name = ScopedHandleT<_deleter_ ## object_name>;

#define VU_HAS_SCOPED_HANDLE

#endif // C++14 (MSVC 2015+ or MinGW 5.1+)
2 changes: 1 addition & 1 deletion include/template/misc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Misc

// C++14 (MSVC 2015+ or MinGW 5.1+)
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(__MINGW32__) && __cplusplus >= 201402L)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201402L)

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion include/template/nameop.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once

// C++14 (MSVC 2015+ or MinGW 5.1+)
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || (defined(__MINGW32__) && __cplusplus >= 201402L)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201402L)

#include "3rdparty/NO/include/base/named_operator.hpp"
#include "3rdparty/NO/include/util/io_helpers.hpp"
Expand Down
4 changes: 2 additions & 2 deletions include/template/singleton.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public:
}

// C++14 (MSVC 2013+ or MinGW 4.6+)
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || (defined(__MINGW32__) && __cplusplus >= 201103L)
#if (defined(_MSC_VER) && _MSVC_LANG >= 201402L) || (defined(__MINGW32__) && __cplusplus >= 201103L)
SingletonT(SingletonT&&) = delete;
SingletonT(SingletonT const&) = delete;
SingletonT& operator=(SingletonT&&) = delete;
SingletonT& operator=(SingletonT const&) = delete;
#endif
#endif // C++14 (MSVC 2013+ or MinGW 4.6+)

static T& instance()
{
Expand Down

0 comments on commit ab0f1d9

Please sign in to comment.