On 8/10/22 09:47, Richard Biener wrote:
> On Wed, Aug 10, 2022 at 9:17 AM Martin Liška <mli...@suse.cz> wrote:
>>
>> On 8/10/22 08:56, Richard Biener wrote:
>>> C++ standard library includes have to go through system.h (#define
>>> INCLUDE_STRING).
>>
>> Oh, yeah. That means I need to rely on the flat header files :/
>>
>>>
>>> Does the API really have to use std::string?
>>
>> I would like to. My main motivation is std::string::rfind function that
>> has no C equivalent (would be rstrstr).
> 
> The old code happily uses strstr though, not worrying about
> finding the last instance of --jobserver-auth?

Yes, sorry, I forgot to mention that, it's something I was notified by the GNU 
make
developer here: https://savannah.gnu.org/bugs/index.php?57242#comment13

> 
> Anyway, I'm not going to insist - I just noticed the actual
> users use .c_str on the error message and adjusting the
> environment for a not working jobserver is done
> inconsistently.  Since I'm coming from C I was more
> expecting sth like
> 
>  bool jobserver_active = probe_jobserver (true /* diagnose */);

Well, the main problem is that I need to "extra" a bunch of information
when parsing the env variable (and each consumer needs something else,
so that's why the jobserver_info members). It was very ugly having all
these return values being given as params (of pointer type).

Martin

> 
> rather than pulling in a class instance from an all-inline
> implementation.  But hey ;)
> 
> 
>>
>> Martin

Reply via email to