1 #include <source/utility.hxx>
9 const char* const file
,
11 const char* const message
,
17 "%s:%d: ", file
, line
);
19 // If buffer was too small, chars contains length
20 // of chars that would've been written. Chars must
21 // be lower than length or else we could not fit
22 // the message into buffer, too.
23 bool didFitIntoBuffer
= chars
< length
;
25 if (didFitIntoBuffer
) {
26 size_t newLength
= length
- chars
;
27 char* const newBuffer
= buffer
+ chars
;
32 didFitIntoBuffer
= chars
<= newLength
;
35 return didFitIntoBuffer
;
41 const char* const file
,
43 const char* const message
,
47 va_start(ap
, message
);
49 bool result
= vformat(
50 buffer
, length
, file
, line
, message
, ap
);