fork(8) download
  1. #include <type_traits>
  2. #include <iostream>
  3.  
  4. //#define USE_REAL
  5.  
  6. enum GLenum {TEST};
  7.  
  8. typedef void (*func_type)(GLenum, const void*);
  9.  
  10. #ifdef USE_REAL
  11. void glDrawArraysIndirect(GLenum, const void*);
  12. #endif
  13.  
  14. namespace detail {
  15. struct dummy {};
  16.  
  17. template<typename T = dummy>
  18. void glDrawArraysIndirect(GLenum, const void*, T = T())
  19. {
  20. std::cout << "In placeholder function" << std::endl;
  21. }
  22.  
  23. }
  24.  
  25. void wrapDraw(GLenum x, const void* y)
  26. {
  27. using namespace detail;
  28. glDrawArraysIndirect(x, y);
  29. }
  30.  
  31. #ifdef USE_REAL
  32. void glDrawArraysIndirect(GLenum, const void*)
  33. {
  34. std::cout << "In real function" << std::endl;
  35. }
  36. #endif
  37.  
  38. int main()
  39. {
  40. wrapDraw(TEST, nullptr);
  41. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
In placeholder function