Skip to content

Commit 92021f3

Browse files
committed
try_builtin_file_line() just to probe what compilers support it.
1 parent dda1b41 commit 92021f3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/pybind11/detail/type_caster_odr_guard.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ inline unsigned &type_caster_odr_violation_detected_counter() {
5151
return counter;
5252
}
5353

54+
inline bool try_builtin_file_line() {
55+
const char *file = __builtin_FILE();
56+
unsigned line = __builtin_LINE();
57+
return file != nullptr && line != 0; // Just something.
58+
}
59+
5460
inline const char *source_file_line_basename(const char *sfl) {
5561
unsigned i_base = 0;
5662
for (unsigned i = 0; sfl[i] != '\0'; i++) {

0 commit comments

Comments
 (0)