Created
          January 25, 2017 22:59 
        
      - 
      
- 
        Save Yepoleb/713e11012aeba5e44d7a5ddd5b5c3caf to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #define _GLIBCXX_USE_CXX11_ABI 1 | |
| #include <ios> | |
| #include <typeinfo> | |
| #include <exception> | |
| extern const std::type_info& old_abi_failure; | |
| const std::type_info& new_abi_failure = typeid(std::ios::failure&); | |
| bool is_ios_failure(std::exception& e) { | |
| const std::type_info& e_type = typeid(e); | |
| if (e_type.hash_code() == old_abi_failure.hash_code()) { | |
| return true; | |
| } else if (e_type.hash_code() == new_abi_failure.hash_code()) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #define _GLIBCXX_USE_CXX11_ABI 0 | |
| #include <ios> | |
| #include <typeinfo> | |
| const std::type_info& old_abi_failure = typeid(std::ios::failure&); | |
| void throw_failure() | |
| { | |
| throw std::ios::failure("stream"); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment