OpenBSD: use portable strtoll instead of strtonum to allow cross-compilation test

This commit is contained in:
Christian Jullien 2021-01-12 08:12:40 +01:00
parent 4d254312be
commit 00d467d44c
2 changed files with 9 additions and 7 deletions

View File

@ -1111,7 +1111,7 @@ ST_FUNC char *tcc_openbsd_library_soversion(TCCState *s, const char *libraryname
{
DIR *dirp;
struct dirent *dp;
const char *e;
char *e;
char **libpaths, *t, *u, *v;
char soname[1024];
long long maj, min, tmaj, tmin;
@ -1134,16 +1134,18 @@ ST_FUNC char *tcc_openbsd_library_soversion(TCCState *s, const char *libraryname
u = strrchr(t, '.');
*u = '\0';
tmin = strtonum(u + 1, 0, LLONG_MAX, &e);
if (e != NULL) {
tmin = strtoll(u + 1, &e, 10);
if (*e != 0) {
tcc_free(t);
t = NULL;
continue;
}
v = strrchr(t, '.');
tmaj = strtonum(v + 1, 0, LLONG_MAX, &e);
if (e != NULL) {
tmaj = strtoll(v + 1, &e, 10);
if (*e != 0) {
tcc_free(t);
t = NULL;
continue;

View File

@ -2540,9 +2540,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
struct ro_inf roinf;
ElfW(Phdr) *phdr;
Section *strsec, *interp, *dynamic, *dynstr, *note = NULL;
#ifndef ELF_OBJ_ONLY
//#ifndef ELF_OBJ_ONLY
struct ro_inf *roinf_use = NULL;
#endif
//#endif
file_type = s1->output_type;