Skip to content

Commit ee6843d

Browse files
committed
Fix -fno-exceptions compile & fix macro warning in amalgamated header
1 parent f5e9aed commit ee6843d

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

include/hexi/binary_stream.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,4 +1097,7 @@ class binary_stream final {
10971097
}
10981098
};
10991099

1100+
#undef SAFE_READ
1101+
#undef STREAM_READ_BOUNDS_ENFORCE
1102+
11001103
} // hexi

include/hexi/pmc/binary_stream_reader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,4 +518,7 @@ class binary_stream_reader : virtual public stream_base {
518518
}
519519
};
520520

521+
#undef SAFE_READ
522+
#undef STREAM_READ_BOUNDS_ENFORCE
523+
521524
} // pmc, hexi

include/hexi/static_buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class static_buffer final {
156156
*/
157157
void resize(size_type size) {
158158
if(size > buffer_.size()) {
159-
throw exception("attempted to resize static_buffer to larger than capacity");
159+
HEXI_THROW(exception("attempted to resize static_buffer to larger than capacity"));
160160
}
161161

162162
write_ = size;

single_include/hexi.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,9 @@ class binary_stream final {
16601660
}
16611661
};
16621662

1663+
#undef SAFE_READ
1664+
#undef STREAM_READ_BOUNDS_ENFORCE
1665+
16631666
} // hexi
16641667

16651668
// #include <hexi/buffer_adaptor.h>
@@ -4179,7 +4182,7 @@ class static_buffer final {
41794182
*/
41804183
void resize(size_type size) {
41814184
if(size > buffer_.size()) {
4182-
throw exception("attempted to resize static_buffer to larger than capacity");
4185+
HEXI_THROW(exception("attempted to resize static_buffer to larger than capacity"));
41834186
}
41844187

41854188
write_ = size;
@@ -5110,6 +5113,9 @@ class binary_stream_reader : virtual public stream_base {
51105113
}
51115114
};
51125115

5116+
#undef SAFE_READ
5117+
#undef STREAM_READ_BOUNDS_ENFORCE
5118+
51135119
} // pmc, hexi
51145120

51155121
// #include <hexi/pmc/binary_stream_writer.h>

0 commit comments

Comments
 (0)