History

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

Christian Jullien committed 5 years ago

Commit 00d467d1 parent 4d254312 files · +9 −7Browse files

Unified · Split

2 files
  1. libtcc.c +7 −5
  2. tccelf.c +2 −2
libtcc.c+7−5
@@ -1111,7 +1111,7 @@ ST_FUNC char *tcc_openbsd_library_soversion(TCCState *s, const char *libraryname · 1110 unmodified lines
11111111 {
11121112 DIR *dirp;
11131113 struct dirent *dp;
1114− const char *e;
1114+ char *e;
11151115 char **libpaths, *t, *u, *v;
11161116 char soname[1024];
11171117 long long maj, min, tmaj, tmin;
@@ -1134,16 +1134,18 @@ ST_FUNC char *tcc_openbsd_library_soversion(TCCState *s, const char *libraryname · 16 unmodified lines
11341134 u = strrchr(t, '.');
11351135 *u = '\0';
11361136
1137− tmin = strtonum(u + 1, 0, LLONG_MAX, &e);
1138− if (e != NULL) {
1137+ tmin = strtoll(u + 1, &e, 10);
1138+
1139+ if (*e != 0) {
11391140 tcc_free(t);
11401141 t = NULL;
11411142 continue;
11421143 }
11431144
11441145 v = strrchr(t, '.');
1145− tmaj = strtonum(v + 1, 0, LLONG_MAX, &e);
1146− if (e != NULL) {
1146+ tmaj = strtoll(v + 1, &e, 10);
1147+
1148+ if (*e != 0) {
11471149 tcc_free(t);
11481150 t = NULL;
11491151 continue;
tccelf.c+2−2
@@ -2540,9 +2540,9 @@ static int elf_output_file(TCCState *s1, const char *filename) · 2539 unmodified lines
25402540 struct ro_inf roinf;
25412541 ElfW(Phdr) *phdr;
25422542 Section *strsec, *interp, *dynamic, *dynstr, *note = NULL;
2543−#ifndef ELF_OBJ_ONLY
2543+//#ifndef ELF_OBJ_ONLY
25442544 struct ro_inf *roinf_use = NULL;
2545−#endif
2545+//#endif
25462546
25472547 file_type = s1->output_type;
25482548

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t