code_junkie

How to handle a class name conflict when porting old code?

Nov 11th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // In a wrapper header, eg: include_oldlib.h...
  2.  
  3. namespace oldlib
  4. {
  5. #include "oldlib.h"
  6. };
  7.  
  8. #ifndef DONT_AUTO_INCLUDE_OLD_NAMESPACE
  9. using namespace oldlib;
  10. #endif
  11.  
  12. #define TObject TMadeUpNameObject
  13.  
  14. namespace oldlib
  15. {
  16. #inclcude "oldlib.h"
  17. };
  18.  
  19. #ifdef Symbol
  20. #undef Symbol
  21. #define Symbol ThirdPartySymbol
  22. #endif
  23. #include <third_party_header.h>
  24. #undef Symbol
Add Comment
Please, Sign In to add comment