Jump to content

Update Client Compilation to ISO C++17


Recommended Posts

Why?

Why not?

Seriously though, why?

I was legit just bored.

 

Ok, first of all, we need to indicate to Visual Studio that we wanna compile with the flag /std:c++17. You do so by selecting all the projects on the right and clicking properties:

2422347RqZibz.png

 

and click on Apply (duh)

Then let's fix the first issue, the introduction of std::byte.

For some reason (and you should never ever ever ever ever ever do it), there are some:

using namespace std;

in the code. DELETE. THEM. ALL.

Now compile. Yeah, it's not over, because now, we should edit all the std functions (make_pair, string, declarations of maps, vectors etc.) adding std:: before, for ex:

operator const string() const { return m_sRaw; }

becomes

operator const std::string() const { return m_sRaw; }

just compile and fix them all whenever you find them.

A few of them are more "difficult".

Open Stl.h in EterBase and there's gonna be:

namespace std
{
	template <class _Ty>
	class void_mem_fun_t
		: public unary_function<_Ty *, void> {
	public:
		explicit void_mem_fun_t(void (_Ty::*_Pm)())
			: _Ptr(_Pm) {}
		void operator()(_Ty *_P) const
		{((_P->*_Ptr)()); }
	private:
		void (_Ty::*_Ptr)();
		};
	template<class _Ty> inline
	void_mem_fun_t<_Ty> void_mem_fun(void (_Ty::*_Pm)())
	{return (void_mem_fun_t<_Ty>(_Pm)); }

	template<class _Ty>
	class void_mem_fun_ref_t : public unary_function<_Ty, void> {
	public:
		explicit void_mem_fun_ref_t(void (_Ty::*_Pm)())
			: _Ptr(_Pm) {}
		void operator()(_Ty& _X) const
		{return ((_X.*_Ptr)()); }
	private:
		void (_Ty::*_Ptr)();
	};

	template<class _Ty> inline
	void_mem_fun_ref_t<_Ty> void_mem_fun_ref(void (_Ty::*_Pm)())
	{return (void_mem_fun_ref_t< _Ty>(_Pm)); }


		// TEMPLATE CLASS mem_fun1_t
template<class _R, class _Ty, class _A>
	class void_mem_fun1_t : public binary_function<_Ty *, _A, _R> {
public:
	explicit void_mem_fun1_t(_R (_Ty::*_Pm)(_A))
		: _Ptr(_Pm) {}
	_R operator()(_Ty *_P, _A _Arg) const
		{return ((_P->*_Ptr)(_Arg)); }
private:
	_R (_Ty::*_Ptr)(_A);
	};
		// TEMPLATE FUNCTION mem_fun1
template<class _R, class _Ty, class _A> inline
	void_mem_fun1_t<_R, _Ty, _A> void_mem_fun1(_R (_Ty::*_Pm)(_A))
	{return (void_mem_fun1_t<_R, _Ty, _A>(_Pm)); }


}

fucking remove this shit.

 

Then replace all the:

std::void_mem_fun

with

std::mem_fn

Then in cipher.cpp replace

std::auto_ptr

into

std::unique_ptr

and then boost is gonna come busting our ass, so just upgrade the folder downloading the last version and..nope:

Quote

Severity    Code    Description    Project    File    Line    Suppression State
Error    C4996    'std::allocator<std::pair<const K,T>>::is_always_equal': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.    SoundLibrary    F:\*******\Third-party\include\boost\unordered\detail\implementation.hpp    1452    
 

Alright, I'd suggest to just disable this error:

How to disable by Microsoft (do it for every project causing this error)

If you fix boost's code, kudos to you.

Then, after a lot of:

Quote

warning C5033: 'register' is no longer a supported storage class

from Python, it should be compiled.

 

If you have ikarus offline shop, you should recompile libconfig with the same settings (probably cryptopp aswell? Honestly I can't remember)

 

  • Love 7
  • Love 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.