Skip to content

Commit

Permalink
Merge pull request #380 from orbitersim/TinyFix
Browse files Browse the repository at this point in the history
Restored a local pointer function
  • Loading branch information
jarmonik authored Jul 26, 2023
2 parents cabac99 + fb7aa64 commit 15a6f4d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions OVP/D3D9Client/D3D9Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ const char *_PTR(const void *p);
#define SURFACE(x) ((class SurfNative *)x)

// helper function to get address of a temporary
// The regular "easy" way no longer works on some compilers so lets use a hack to get a simple thing done.
// NB: use with caution

template<typename T>
T* ptr(T&& x) { return &x; }

// Required only with c++20 without /permissive flag
// template<typename T>
// T* ptr(T&& x) { return &x; }

#define ptr & // use for faster code

// ------------------------------------------------------------------------------------
// Vertex Declaration equal to NTVERTEX
Expand Down

0 comments on commit 15a6f4d

Please sign in to comment.