defines.h 725 B

123456789101112131415161718192021222324252627
  1. // defines.h :
  2. //
  3. #if !defined(AGD_DEFINES_H__DDEAB8B0_8BCD_468E_B490_46C8E63A29D4__INCLUDED_)
  4. #define AGD_DEFINES_H__DDEAB8B0_8BCD_468E_B490_46C8E63A29D4__INCLUDED_
  5. /////////////////////////////////////////////////////////////////////////////
  6. // defines.h - Declarations:
  7. #ifdef __cplusplus
  8. template <class T>
  9. inline static const T& __min(const T& a, const T& b)
  10. {
  11. return (a < b) ? a : b;
  12. }
  13. template <class T>
  14. inline static const T& __max(const T& a, const T& b)
  15. {
  16. return (a > b) ? a : b;
  17. }
  18. #else // __cplusplus
  19. #define __min(x, y) (((x) < (y)) ? (x) : (y))
  20. #define __max(x, y) (((x) > (y)) ? (x) : (y))
  21. #endif // __cplusplus
  22. #endif // !defined(AGD_DEFINES_H__DDEAB8B0_8BCD_468E_B490_46C8E63A29D4__INCLUDED_)