I support an open source program that builds using autoconf.
Now I have problems with some of my users. They use a pre-distributed virtual machine from an organization that has the wrong prototype for strchr. Their prototype:
char *strchr(char *,int c);
when, of course, we know what it should be:
char *strchr(const char *s,int c);
(which in itself is broken, since the conclusion must be valid const char *, but then you could not change what it gives you if you passed in char *, not const char *, but I got distracted.
My question is: is there a way to create an autoconf macro that determines which prototype is being used and use it appropriately? I do not want my code to say:
v = strchr((char *)s,c);
Thank!