code_junkie

C++ mark as deprecated

Nov 12th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #ifdef __GNUC__
  2. #define DEPRECATED(func) func __attribute__ ((deprecated))
  3. #elif defined(_MSC_VER)
  4. #define DEPRECATED(func) __declspec(deprecated) func
  5. #else
  6. #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
  7. #define DEPRECATED(func) func
  8. #endif
  9.  
  10. ...
  11.  
  12. //don't use me any more
  13. DEPRECATED(void OldFunc(int a, float b));
  14.  
  15. //use me instead
  16. void NewFunc(int a, double b);
Add Comment
Please, Sign In to add comment