Commit a7417421 authored by charras's avatar charras
Browse files

back to EXCHG macro (equivalent inline functions do not work, this is a stupid error from myself )

parent 443c6449
Loading
Loading
Loading
Loading
+0 −43
Original line number Original line Diff line number Diff line
@@ -54,51 +54,8 @@
/* inline functions to exchange 2 items */
/* inline functions to exchange 2 items */
/****************************************/
/****************************************/


#if 1
#define EXCHG( a, b ) { typeof(a) __temp__ = (a); (a) = (b); (b) = __temp__; }
#define EXCHG( a, b ) { typeof(a) __temp__ = (a); (a) = (b); (b) = __temp__; }


#else
static inline void EXCHG( int a, int b )
{
    int temp = a;
    a = b;
    b = temp;
};

static inline void EXCHG( int* a, int* b )
{
    int* temp = a;
    a = b;
    b = temp;
};

static inline void EXCHG( double a, double b )
{
    double temp = a;
    a = b;
    b = temp;
};

static inline void EXCHG( wxPoint a, wxPoint b )
{
    wxPoint temp = a;
    a = b;
    b = temp;
};

static inline void EXCHG( wxSize a, wxSize b )
{
    wxSize temp = a;
    a = b;
    b = temp;
};

static inline void EXCHG( const wxChar* a, const wxChar* b )
{
    const wxChar* temp = a;
    a = b;
    b = temp;
};


class Hierarchical_PIN_Sheet_Struct;
class Hierarchical_PIN_Sheet_Struct;
static inline void EXCHG( const Hierarchical_PIN_Sheet_Struct* a, const Hierarchical_PIN_Sheet_Struct* b )
static inline void EXCHG( const Hierarchical_PIN_Sheet_Struct* a, const Hierarchical_PIN_Sheet_Struct* b )