mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-26 08:00:09 +08:00
OpenBSD: use portable strtoll instead of strtonum to allow cross-compilation test
This commit is contained in:
parent
4d254312be
commit
00d467d44c
12
libtcc.c
12
libtcc.c
@ -1111,7 +1111,7 @@ ST_FUNC char *tcc_openbsd_library_soversion(TCCState *s, const char *libraryname
|
|||||||
{
|
{
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
const char *e;
|
char *e;
|
||||||
char **libpaths, *t, *u, *v;
|
char **libpaths, *t, *u, *v;
|
||||||
char soname[1024];
|
char soname[1024];
|
||||||
long long maj, min, tmaj, tmin;
|
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 = strrchr(t, '.');
|
||||||
*u = '\0';
|
*u = '\0';
|
||||||
|
|
||||||
tmin = strtonum(u + 1, 0, LLONG_MAX, &e);
|
tmin = strtoll(u + 1, &e, 10);
|
||||||
if (e != NULL) {
|
|
||||||
|
if (*e != 0) {
|
||||||
tcc_free(t);
|
tcc_free(t);
|
||||||
t = NULL;
|
t = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = strrchr(t, '.');
|
v = strrchr(t, '.');
|
||||||
tmaj = strtonum(v + 1, 0, LLONG_MAX, &e);
|
tmaj = strtoll(v + 1, &e, 10);
|
||||||
if (e != NULL) {
|
|
||||||
|
if (*e != 0) {
|
||||||
tcc_free(t);
|
tcc_free(t);
|
||||||
t = NULL;
|
t = NULL;
|
||||||
continue;
|
continue;
|
||||||
|
4
tccelf.c
4
tccelf.c
@ -2540,9 +2540,9 @@ static int elf_output_file(TCCState *s1, const char *filename)
|
|||||||
struct ro_inf roinf;
|
struct ro_inf roinf;
|
||||||
ElfW(Phdr) *phdr;
|
ElfW(Phdr) *phdr;
|
||||||
Section *strsec, *interp, *dynamic, *dynstr, *note = NULL;
|
Section *strsec, *interp, *dynamic, *dynstr, *note = NULL;
|
||||||
#ifndef ELF_OBJ_ONLY
|
//#ifndef ELF_OBJ_ONLY
|
||||||
struct ro_inf *roinf_use = NULL;
|
struct ro_inf *roinf_use = NULL;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
file_type = s1->output_type;
|
file_type = s1->output_type;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user