@@ -47,13 +47,13 @@ void unmap_file(char *data, size_t length);
47
47
}
48
48
49
49
#include < cstddef>
50
- #ifndef NO_EXCEPTIONS
50
+ #ifdef __EXCEPTIONS
51
51
#include < stdexcept>
52
52
#include < sstream>
53
- #else /* NO_EXCEPTIONS */
53
+ #else /* __EXCEPTIONS */
54
54
#include < cstdlib>
55
55
#include < iostream>
56
- #endif /* NO_EXCEPTIONS */
56
+ #endif /* __EXCEPTIONS */
57
57
58
58
/* !
59
59
* mapped_file allows you to create a simple read-only file mapping in an
@@ -76,14 +76,14 @@ class mapped_file
76
76
mapped_file (const char *path) : size_(), data_() {
77
77
data_ = map_file (path, &size_);
78
78
if (!data_) {
79
- #ifndef NO_EXCEPTIONS
79
+ #ifdef __EXCEPTIONS
80
80
std::ostringstream o;
81
81
o << " Couldn't open File \" " << path << " \" " ;
82
82
throw io_exception (o.str ());
83
- #else /* NO_EXCEPTIONS */
84
- std::clog << " Couldn't open File \" " << path << " \" " << std::endl;
83
+ #else /* __EXCEPTIONS */
84
+ std::cerr << " Couldn't open File \" " << path << " \" " << std::endl;
85
85
std::exit (EXIT_FAILURE);
86
- #endif /* NO_EXCEPTIONS */
86
+ #endif /* __EXCEPTIONS */
87
87
}
88
88
}
89
89
/* !
@@ -105,13 +105,13 @@ class mapped_file
105
105
*/
106
106
const char * operator *() const { return data_; }
107
107
108
- #ifndef NO_EXCEPTIONS
108
+ #ifdef __EXCEPTIONS
109
109
struct io_exception : public std ::runtime_error
110
110
{
111
111
io_exception (const std::string& message)
112
112
: std::runtime_error(message) { }
113
113
};
114
- #endif /* NO_EXCEPTIONS */
114
+ #endif /* __EXCEPTIONS */
115
115
};
116
116
#endif /* __cplusplus */
117
117
0 commit comments