Update tl-parser in release builds

- Changed assertions to abort to allow the build to fail on release
  targets
- Fixed some wrong assertion
- Changed all stderr print to the respective macro
This commit is contained in:
Christian Rendina 2020-12-24 18:55:35 +01:00
parent 98b469c21d
commit d137b75516
2 changed files with 305 additions and 312 deletions

File diff suppressed because it is too large Load Diff

7
tlc.c
View File

@ -24,7 +24,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h>
#if defined(_MSC_VER) #if defined(_MSC_VER)
#include <io.h> #include <io.h>
@ -65,19 +64,17 @@ int vkext_write (const char *filename) {
if (r != 0) if (r != 0)
{ {
fprintf(stderr, "Cannot write file %s\n", filename); fprintf(stderr, "Cannot write file %s\n", filename);
return -1; abort();
} }
#elif defined(WIN32) || defined(_WIN32) #elif defined(WIN32) || defined(_WIN32)
int f = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0640); int f = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0640);
assert(f >= 0);
#else #else
int f = open (filename, O_CREAT | O_WRONLY | O_TRUNC, 0640); int f = open (filename, O_CREAT | O_WRONLY | O_TRUNC, 0640);
assert (f >= 0);
#endif #endif
if (!f) if (!f)
{ {
fprintf(stderr, "Cannot write file %s\n", filename); fprintf(stderr, "Cannot write file %s\n", filename);
return -1; abort();
} }
write_types (f); write_types (f);
close (f); close (f);