| 115 | } |
| 116 | |
| 117 | void msg_error(const char *fmt,...) |
| 118 | { |
| 119 | va_list ap; |
| 120 | |
| 121 | va_start (ap, fmt); |
| 122 | |
| 123 | if (__pre_write_fn) { |
| 124 | #if (defined(_WIN32) || defined(_WIN64)) && _MSC_VER < 1900 |
| 125 | __pre_write_fn(__pre_write_ctx, fmt, ap); |
| 126 | #else |
| 127 | va_list ap_tmp; |
| 128 | va_copy(ap_tmp, ap); |
| 129 | __pre_write_fn(__pre_write_ctx, fmt, ap_tmp); |
| 130 | #endif |
| 131 | } |
| 132 | |
| 133 | if (__stdout_enable) { |
| 134 | #if (defined(_WIN32) || defined(_WIN64)) && _MSC_VER < 1900 |
| 135 | printf("msg_error->pid(%d), ", GETPID()); |
| 136 | vprintf(fmt, ap); |
| 137 | #else |
| 138 | va_list ap_tmp; |
| 139 | va_copy(ap_tmp, ap); |
| 140 | printf("msg_error->pid(%d), ", GETPID()); |
| 141 | vprintf(fmt, ap_tmp); |
| 142 | #endif |
| 143 | printf("\r\n"); |
| 144 | } |
| 145 | |
| 146 | if (__write_fn != NULL) { |
| 147 | __write_fn(__msg_ctx, fmt, ap); |
| 148 | } |
| 149 | |
| 150 | va_end (ap); |
| 151 | } |
| 152 | |
| 153 | void msg_fatal(const char *fmt,...) |
| 154 | { |
no outgoing calls
no test coverage detected
searching dependent graphs…