Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUT]Howto use Visual Studio 2013 instead 2008 crap

Joined
Sep 27, 2006
Messages
557
Reaction score
88
Or you can just compile it in 2013...

r3dCompileAssert.h

Code:
#pragma once

// compile time assert
#ifdef __cplusplus
#define JOIN( X, Y ) JOIN2(X,Y)
#define JOIN2( X, Y ) X##Y
namespace assert_static
{
    template <bool> struct STATIC_ASSERT_FAILURE;
    template <> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };

    template<int x> struct static_assert_test{};
}
#define COMPILE_ASSERT(x) \
    typedef ::assert_static::static_assert_test<\
    sizeof(::assert_static::STATIC_ASSERT_FAILURE< (bool)( x ) >)>\
    JOIN(_static_assert_typedef, __LINE__)
#else // __cplusplus
#define COMPILE_ASSERT(x) extern int __dummy[(int)x]
#endif // __cplusplus
#define VERIFY_EXPLICIT_CAST(from, to) COMPILE_ASSERT(sizeof(from) == sizeof(to))

r3dSTLAllocators.h

Code:
//=========================================================================
//    Module: r3dSTLAllocators.h
//=========================================================================

#if     _MSC_VER > 1000 /*IFSTRIP=IGN*/
#pragma once
#endif
#ifdef  _MSC_VER
#pragma pack(push,8)
#endif  /* _MSC_VER */
#include <limits>
#ifndef _FARQ    /* specify standard memory model */
#define _FARQ
#define _PDFT    ptrdiff_t
#define _SIZT    size_t
#endif
#define _POINTER_X(T, A)    T _FARQ *
#define _REFERENCE_X(T, A)    T _FARQ &
//////////////////////////////////////////////////////////////////////////

template <typename T, int AT>
class r3dSTLCustomAllocator
{
public:
    //type definitions
    typedef size_t    size_type;
    typedef ptrdiff_t difference_type;
    typedef T*        pointer;
    typedef const T*  const_pointer;
    typedef T&        reference;
    typedef const T&  const_reference;
    typedef T         value_type;

    //rebind allocator to type U
    template <class U>
    struct rebind
    {
        typedef r3dSTLCustomAllocator<U, AT> other;
    };


    //return address of values
    pointer address (reference value) const
    {
        return &value;
    }
    const_pointer address (const_reference value) const
    {
        return &value;
    }
    /*constructors and destructor
    *-nothing to do because the allocator has no state
    */
    r3dSTLCustomAllocator() throw() {}
    r3dSTLCustomAllocator(const r3dSTLCustomAllocator&) throw() {}
    template <class U>
    r3dSTLCustomAllocator (const r3dSTLCustomAllocator<U, AT>&) throw() {}
    ~r3dSTLCustomAllocator() throw() {}

    //return maximum number of elements that can be allocated
    size_type max_size () const throw()
    {
        //for numeric_limits see Section 4.3, page 59
        return std::numeric_limits<size_t>::max() / sizeof(T);
    }

    //allocate but don't initialize num elements of type T
    pointer allocate (size_type num, typename r3dSTLCustomAllocator<void, AT>::const_pointer hint = 0)
    {
        //allocate memory with global new
        return (pointer) r3dAllocateMemory(num * sizeof(T), 1, static_cast<r3dAllocationTypes>(AT));
    }


    //initialize elements of allocated storage p with value value
    void construct (pointer p, const T& value)
    {
        //initialize memory with placement new
        new((void*)p)T(value);
    }


    //destroy elements of initialized storage p
    void destroy (pointer p)
    {
        // destroy objects by calling their destructor
        p->~T();
    }


    //deallocate storage p of deleted elements
    void deallocate (pointer p, size_type num)
    {
        //deallocate memory with global delete
        r3dDeallocateMemory(p, 1, static_cast<r3dAllocationTypes>(AT));
    }
};

//return that all specializations of this allocator are interchangeable
template <class T1, class T2, int AT>
bool operator== (const r3dSTLCustomAllocator<T1, AT>&,
                 const r3dSTLCustomAllocator<T2, AT>&) throw()
{
    return true;
}
template <class T1, class T2, int AT>
bool operator!= (const r3dSTLCustomAllocator<T1, AT>&,
                 const r3dSTLCustomAllocator<T2, AT>&) throw()
{
    return false;
}

//////////////////////////////////////////////////////////////////////////

template<int AT>
class r3dSTLCustomAllocator<void, AT>
{    // allocator for type void
public:
    typedef void _Ty;
    typedef _Ty _FARQ *pointer;
    typedef const _Ty _FARQ *const_pointer;
    typedef _Ty value_type;

    template<class _Other>
    struct rebind
    {    // convert an allocator<void> to an allocator <_Other>
        typedef r3dSTLCustomAllocator<_Other, AT> other;
    };

    r3dSTLCustomAllocator() _THROW0()
    {    // construct default allocator (do nothing)
    }

    r3dSTLCustomAllocator(const r3dSTLCustomAllocator<_Ty, AT>&) _THROW0()
    {    // construct by copying (do nothing)
    }

    template<class _Other>
    r3dSTLCustomAllocator(const r3dSTLCustomAllocator<_Other, AT>&) _THROW0()
    {    // construct from related allocator (do nothing)
    }

    template<class _Other>
    r3dSTLCustomAllocator<_Ty, AT>& operator=(const r3dSTLCustomAllocator<_Other, AT>&)
    {    // assign from a related allocator (do nothing)
        return (*this);
    }
};

still will have issues with AutodeskNav\lib as they where compiled with vs2008....
 
Newbie Spellweaver
Joined
Nov 9, 2013
Messages
65
Reaction score
48
If u're using 2008 as Platform, there is no profit from the newer compiler etc.
Not having to use the ugly buggy slow turtle piece of crap is already a valid reason for me.
Aswell as Remote Debugging.
 
Junior Spellweaver
Joined
Apr 2, 2016
Messages
120
Reaction score
76
Just a note, for who want to try, it works on VS2012.

Can someone make a small tutorial because we have some code here and I wanna convert the solution to VS2012.
Thanks.
 
Experienced Elementalist
Joined
Aug 20, 2015
Messages
205
Reaction score
43
aLca - [TUT]Howto use Visual Studio 2013 instead 2008 crap - RaGEZONE Forums
 
Junior Spellweaver
Joined
Dec 23, 2014
Messages
128
Reaction score
26
Read the OP again ..... use the v3 stuff aswell.
 
Newbie Spellweaver
Joined
Sep 8, 2018
Messages
43
Reaction score
5
i need help

i get this error:

i use vs 2013 Ultimate with Update 5

i get this error on Windows 10 and 8.1

I have already changed the "handle alert as error" to no

i need help with this too

i use the afterlifemmo source and the codex src
 
Newbie Spellweaver
Joined
Sep 8, 2018
Messages
43
Reaction score
5
not working...

EDIT
i change std::make_pair to std::pair and now its work
 
Newbie Spellweaver
Joined
Jul 23, 2016
Messages
17
Reaction score
3
I have clean Eternity/Lib and some errors, i back lib and errors

Cwbbryb - [TUT]Howto use Visual Studio 2013 instead 2008 crap - RaGEZONE Forums


qAa8OOd - [TUT]Howto use Visual Studio 2013 instead 2008 crap - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Jul 23, 2016
Messages
17
Reaction score
3
40IWXTd - [TUT]Howto use Visual Studio 2013 instead 2008 crap - RaGEZONE Forums




I`m very sorry, I'm still in the beginner course to Visual Studio IDE.
I work and become available to study Udemy only in the evenings. sorry for me being very dumb.
But I thank you from the bottom of my heart for this wonderful code
 

Attachments

You must be registered for see attachments list
Back
Top