Advertisement
Kapa3a

Update C++14 -> C++17

Nov 29th, 2023 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.85 KB | Source Code | 0 0
  1. Tutorial video By Kapa3a : https://youtu.be/BjljF7jOyE4?si=S5BvNNRu1MHXNeMR
  2.  
  3.  
  4.  
  5. Step 1:
  6.  
  7.  
  8.  
  9. First, we open the client source with visual studio 2019/2022.
  10.  
  11.  
  12.  
  13. Select all projects and right click on them -> properties -> General -> c++ language standard -> Here we choose c++17.
  14.  
  15. https://imgur.com/a/1XSuqBj
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. Step 2:
  23.  
  24.  
  25.  
  26. In each file (ctrl + shift +f) , we search for the following & delete them:
  27.  
  28.  
  29.  
  30. using namespace std;
  31. Step 3:
  32.  
  33.  
  34.  
  35. Now the following details need to be modified (every file):
  36.  
  37.  
  38.  
  39. string
  40.  
  41. pair
  42.  
  43. make_pair
  44.  
  45. vector
  46.  
  47.  
  48.  to
  49.  
  50. std::string
  51.  
  52. std::pair
  53.  
  54. std::make_pair
  55.  
  56. std::vector
  57.  
  58.  
  59. Step 4:
  60.  
  61.  
  62.  
  63. Open Eterbase project stl.h file and delete this code:
  64.  
  65. namespace std
  66.  
  67. {
  68.  
  69.     template <class _Ty>
  70.  
  71.     class void_mem_fun_t
  72.  
  73.         : public unary_function<_Ty *, void> {
  74.  
  75.     public:
  76.  
  77.         explicit void_mem_fun_t(void (_Ty::*_Pm)())
  78.  
  79.             : _Ptr(_Pm) {}
  80.  
  81.         void operator()(_Ty *_P) const
  82.  
  83.         {((_P->*_Ptr)()); }
  84.  
  85.     private:
  86.  
  87.         void (_Ty::*_Ptr)();
  88.  
  89.         };
  90.  
  91.     template<class _Ty> inline
  92.  
  93.     void_mem_fun_t<_Ty> void_mem_fun(void (_Ty::*_Pm)())
  94.  
  95.     { return (void_mem_fun_t<_Ty>(_Pm)); }
  96.  
  97.  
  98.  
  99.     template<class _Ty>
  100.  
  101.     class void_mem_fun_ref_t : public unary_function<_Ty, void> {
  102.  
  103.     public:
  104.  
  105.         explicit void_mem_fun_ref_t(void (_Ty::*_Pm)())
  106.  
  107.             : _Ptr(_Pm) {}
  108.  
  109.         void operator()(_Ty& _X) const
  110.  
  111.         { return ((_X.*_Ptr)()); }
  112.  
  113.     private:
  114.  
  115.         void (_Ty::*_Ptr)();
  116.  
  117.     };
  118.  
  119.  
  120.  
  121.     template<class _Ty> inline
  122.  
  123.     void_mem_fun_ref_t<_Ty> void_mem_fun_ref(void (_Ty::*_Pm)())
  124.  
  125.     { return (void_mem_fun_ref_t< _Ty>(_Pm)); }
  126.  
  127.  
  128.  
  129.  
  130.  
  131.         // TEMPLATE CLASS mem_fun1_t
  132.  
  133. template<class _R, class _Ty, class _A>
  134.  
  135.     class void_mem_fun1_t : public binary_function<_Ty *, _A, _R> {
  136.  
  137. public:
  138.  
  139.     explicit void_mem_fun1_t(_R (_Ty::*_Pm)(_A))
  140.  
  141.         : _Ptr(_Pm) {}
  142.  
  143.     _R operator()(_Ty *_P, _A _Arg) const
  144.  
  145.         { return ((_P->*_Ptr)(_Arg)); }
  146.  
  147. private:
  148.  
  149.     _R (_Ty::*_Ptr)(_A);
  150.  
  151.     };
  152.  
  153.         // TEMPLATE FUNCTION mem_fun1
  154.  
  155. template<class _R, class _Ty, class _A> inline
  156.  
  157.     void_mem_fun1_t<_R, _Ty, _A> void_mem_fun1(_R (_Ty::*_Pm)(_A))
  158.  
  159.     { return (void_mem_fun1_t<_R, _Ty, _A>(_Pm)); }
  160.  
  161.  
  162.  
  163.  
  164.  
  165. }
  166.  
  167.  
  168. Step 5:
  169.  
  170.  
  171.  
  172. In each file (ctrl + shift +f) , we search for the following & modify them:
  173.  
  174.  
  175.  
  176. std::void_mem_fun
  177.  
  178.  
  179. to
  180.  
  181.  
  182.  
  183. std::mem_fn
  184.  
  185.  
  186. this
  187.  
  188.  
  189.  
  190. std::auto_ptr
  191.  to:
  192.  
  193.  
  194.  
  195. std::unique_ptr
  196.  
  197.  
  198. Step 6:
  199.  
  200.  
  201.  
  202. Open userinterface/userinterface.cpp
  203.  
  204.  
  205.  
  206. Search this:
  207.  
  208. extern "C" {
  209.  
  210. extern int _fltused;
  211.  
  212. volatile int _AVOID_FLOATING_POINT_LIBRARY_BUG = _fltused;
  213.  
  214. };
  215.  
  216.  
  217. add under this:
  218.  
  219.  extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }
  220.  
  221.  
  222. Step 7:
  223.  
  224.  
  225.  
  226. Open Speherelib/spherepack.h
  227.  
  228.  
  229.  
  230. modify this:
  231.  
  232. inline void LostChild(SpherePack *pack);
  233.  
  234.  
  235. to:
  236.  
  237.  
  238.  
  239. void LostChild(SpherePack *pack);
  240.  
  241.  
  242. Step 8:
  243.  
  244.  
  245.  
  246.  
  247.  
  248. open etherBase/cipher.h
  249.  
  250.  
  251.  
  252. search this:
  253.  
  254. #include <cryptopp/cryptlib.h>
  255.  
  256. #pragma warning(pop)
  257.  
  258.  
  259. add under this:
  260.  
  261.  
  262.  
  263. using CryptoPP::byte;
  264.  
  265.  
  266.  
  267.  
  268. Step 9
  269.  
  270.  
  271.  
  272. Open etherpack/Eterpack.h
  273.  
  274. #include <boost/unordered_map.hpp>
  275.  
  276. #include <boost/shared_array.hpp>
  277.  
  278.  
  279. modify to:
  280.  
  281.  
  282.  
  283. #include <unordered_map>
  284.  
  285.  
  286. Replace all file this:
  287.  
  288.  
  289.  
  290. boost::
  291.  
  292.  
  293. to:
  294.  
  295.  
  296.  
  297. std::
  298.  
  299.  
  300. Open etherpack/EterpackManager.h & EterPackPolicy_CSHybridCrypt.h
  301.  
  302.  
  303.  
  304. modify this:
  305.  
  306.  
  307.  
  308. #include <boost/unordered_map.hpp>
  309.  
  310.  
  311. to
  312.  
  313.  
  314.  
  315. #include <unordered_map>
  316.  
  317.  
  318.  
  319.  
  320. Open GameLib/Area.cpp
  321.  
  322.  
  323.  
  324. remove this:
  325.  
  326.  
  327.  
  328. #include <boost/algorithm/string.hpp>
  329.  
  330.  
  331. and this:
  332.  
  333.  
  334.  
  335. boost::algorithm::to_lower(attrFileName);
  336.  
  337.  
  338. modify to:
  339.  
  340.  
  341.  
  342. std::transform(attrFileName.begin(), attrFileName.end(), attrFileName.begin(), [](unsigned char c) { return std::tolower(c); });
  343.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement