deprecated.h 959 B

12345678910111213141516171819202122232425262728
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_DEPRECATED_H
  9. #define IGL_DEPRECATED_H
  10. // Macro for marking a function as deprecated.
  11. //
  12. // http://stackoverflow.com/a/295229/148668
  13. #ifdef __GNUC__
  14. #define IGL_DEPRECATED(func) func __attribute__ ((deprecated))
  15. #elif defined(_MSC_VER)
  16. #define IGL_DEPRECATED(func) __declspec(deprecated) func
  17. #else
  18. #pragma message("WARNING: You need to implement IGL_DEPRECATED for this compiler")
  19. #define IGL_DEPRECATED(func) func
  20. #endif
  21. // Usage:
  22. //
  23. // template <typename T> IGL_INLINE void my_func(Arg1 a);
  24. //
  25. // becomes
  26. //
  27. // template <typename T> IGL_INLINE IGL_DEPRECATED(void my_func(Arg1 a));
  28. #endif