#include <type_traits>
#include <iostream>
//#define USE_REAL
enum GLenum {TEST};
typedef void (*func_type)(GLenum, const void*);
#ifdef USE_REAL
void glDrawArraysIndirect(GLenum, const void*);
#endif
namespace detail {
struct dummy {};
template<typename T = dummy>
void glDrawArraysIndirect(GLenum, const void*, T = T())
{
std::cout << "In placeholder function" << std::endl;
}
}
void wrapDraw(GLenum x, const void* y)
{
using namespace detail;
glDrawArraysIndirect(x, y);
}
#ifdef USE_REAL
void glDrawArraysIndirect(GLenum, const void*)
{
std::cout << "In real function" << std::endl;
}
#endif
int main()
{
wrapDraw(TEST, nullptr);
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgojaW5jbHVkZSA8aW9zdHJlYW0+CgovLyNkZWZpbmUgVVNFX1JFQUwKCmVudW0gR0xlbnVtIHtURVNUfTsKCnR5cGVkZWYgdm9pZCAoKmZ1bmNfdHlwZSkoR0xlbnVtLCBjb25zdCB2b2lkKik7CgojaWZkZWYgVVNFX1JFQUwKdm9pZCBnbERyYXdBcnJheXNJbmRpcmVjdChHTGVudW0sIGNvbnN0IHZvaWQqKTsKI2VuZGlmCgpuYW1lc3BhY2UgZGV0YWlsIHsKICAgIHN0cnVjdCBkdW1teSB7fTsKCiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBUID0gZHVtbXk+CiAgICB2b2lkIGdsRHJhd0FycmF5c0luZGlyZWN0KEdMZW51bSwgY29uc3Qgdm9pZCosIFQgPSBUKCkpCiAgICB7CiAgICAJc3RkOjpjb3V0IDw8ICJJbiBwbGFjZWhvbGRlciBmdW5jdGlvbiIgPDwgc3RkOjplbmRsOwogICAgfQogIAp9Cgp2b2lkIHdyYXBEcmF3KEdMZW51bSB4LCBjb25zdCB2b2lkKiB5KQp7CiAgdXNpbmcgbmFtZXNwYWNlIGRldGFpbDsKICBnbERyYXdBcnJheXNJbmRpcmVjdCh4LCB5KTsKfQoKI2lmZGVmIFVTRV9SRUFMCnZvaWQgZ2xEcmF3QXJyYXlzSW5kaXJlY3QoR0xlbnVtLCBjb25zdCB2b2lkKikKewoJc3RkOjpjb3V0IDw8ICJJbiByZWFsIGZ1bmN0aW9uIiA8PCBzdGQ6OmVuZGw7Cn0KI2VuZGlmCgppbnQgbWFpbigpCnsKCXdyYXBEcmF3KFRFU1QsIG51bGxwdHIpOwp9