summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorFrank Kotler <fbkotler@users.sourceforge.net>2007-08-26 05:48:54 +0000
committerFrank Kotler <fbkotler@users.sourceforge.net>2007-08-26 05:48:54 +0000
commit7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4 (patch)
treeea49eede7dbcd60408ef4eae0c89f07181a96a28 /nasmlib.c
parent2ad45a56b40d2dabefac770d38068511368223a2 (diff)
downloadnasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.tar.gz
nasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.tar.bz2
nasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.zip
add nasm_strsep to nasmlib, for output/outmacho.c - strtok doesn't work
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/nasmlib.c b/nasmlib.c
index fd38812..20535c8 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -156,6 +156,25 @@ int nasm_strnicmp(const char *s1, const char *s2, int n)
}
#endif
+#if !defined(strsep)
+char *nasm_strsep(char **stringp, const char *delim)
+{
+ char *s = *stringp;
+ char *e;
+
+ if (!s)
+ return NULL;
+
+ e = strpbrk(s, delim);
+ if (e)
+ *e++ = '\0';
+
+ *stringp = e;
+ return s;
+}
+#endif
+
+
#define lib_isnumchar(c) ( isalnum(c) || (c) == '$')
#define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
@@ -755,7 +774,7 @@ int stdscan(void *private_data, struct tokenval *tv)
if (isidstart(*stdscan_bufptr) ||
(*stdscan_bufptr == '$' && isidstart(stdscan_bufptr[1]))) {
/* now we've got an identifier */
- int i;
+ uint32_t i;
int is_sym = FALSE;
if (*stdscan_bufptr == '$') {