ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/10/18/11:23:53

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Message-ID: <4E9D9895.2080307@iki.fi>
Date: Tue, 18 Oct 2011 18:17:41 +0300
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: I need strtok_r() function
References: <bf04ff58-89d4-46fe-aaf4-ad5a07eaf8ff AT k35g2000yqh DOT googlegroups DOT com> <8339erwjdk DOT fsf AT gnu DOT org> <3533b2fa-8962-47c1-a6a8-373cc0e8a1f3 AT g7g2000vbv DOT googlegroups DOT com> <83zkgzv01r DOT fsf AT gnu DOT org> <153d7dc6-0ff9-4ef2-9933-e603b92db585 AT m4g2000yqm DOT googlegroups DOT com>
In-Reply-To: <153d7dc6-0ff9-4ef2-9933-e603b92db585@m4g2000yqm.googlegroups.com>
Reply-To: djgpp AT delorie DOT com

On 10/18/2011 04:05 PM, RayeR wrote:
>> If you want less source level changes, you can define a macro,
>> something like (untested):
>>
>>    #define strtok_r(s1,s2,s3)  strtok(s1,s2)

It is easy to create example when simple strtok() is not sufficient
even without threads. One may want to split into tokens several
strings (take first token from the first string, then first from
the second, second and following tokens from both source strings
in the same way).

In that case strtok(s1, s2) will not work properly. With it one must
extract all tokens from the first string and only after that strtok
can be used for splitting another string.

So I think that we may need also strtok_r() for DJGPP

>
> Thanks for explanation. I used the macro and it compiled OK. Maybe it
> would be usefull to include this macro to djgpp string.h
> Unfortunately when I tested compiled x264 to compress sample video it
> crashes immediatelly:
>
> C:\X264>X264.EXE -o out.flv example.y4m
> y4m [info]: 384x288p 0:0 @ 25/1 fps (cfr)
> x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle
> SSE4.2
> x264 [info]: profile High, level 2.1
> Exiting due to signal SIGSEGV
> General Protection Fault at eip=000d9e10
> eax=00a39f10 ebx=00a1fdb0 ecx=000001c0 edx=00a39f10 esi=00226eb0
> edi=00226eb0
> ebp=00000000 esp=001f3eec program=C:\X264\X264.EXE
> cs: sel=01a7  base=029e0000  limit=00acffff
> ds: sel=01af  base=029e0000  limit=00acffff
> es: sel=01af  base=029e0000  limit=00acffff
> fs: sel=017f  base=00005e10  limit=0000ffff
> gs: sel=01bf  base=00000000  limit=0010ffff
> ss: sel=01af  base=029e0000  limit=00acffff
> App stack: [001f4bb8..00174bbc]  Exceptn stack: [00174adc..00172b9c]
>
> (running under XP NTVDM)
> maybe it's issue with sse or something else messed up...
>
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019