In C ++ 11, you can use std::conditionaland std::is_samehow:
#define GL_MYTYPE std::conditional \
< std::is_same<MYTYPE,float>::value, \
GL_FLOAT, \
GL_DOUBLE \
>::type
++ 03 :
template<bool B, class T, class F>
struct conditional { typedef T type; };
template<class T, class F>
struct conditional<false, T, F> { typedef F type; };
template<class T, class U>
struct is_same { static const bool value = false; };
template<class T>
struct is_same<T, T> { static const bool value = true; };
, conditional .