X-Git-Url: https://git.jankratochvil.net/?p=mdsms.git;a=blobdiff_plain;f=acconfig.h;h=4859a4b6042c336098482f141f683a1709ca9d86;hp=c20241f71937974f095e1d2c2e3c01160e02377e;hb=3b127365dbbc640bc1a0813b24baa925b99f5079;hpb=ff9aca63e50c661c59deec9d285ae8173ddec802 diff --git a/acconfig.h b/acconfig.h index c20241f..4859a4b 100644 --- a/acconfig.h +++ b/acconfig.h @@ -39,22 +39,36 @@ #undef HAVE_CBAUDEX #undef CBAUDEX +/* FD_SETSIZE define, may be missing. */ +#undef HAVE_FD_SETSIZE + +/* offsetof() define, may be missing. */ +#undef HAVE_OFFSETOF + /* snprintf(3) unsafe emulation */ #undef HAVE_SNPRINTF /* vsnprintf(3) unsafe emulation */ #undef HAVE_VSNPRINTF -/* printf family accepts %m */ -#undef PRINTF_WORKS_PM - /* found lockfile directory */ #undef DEF_LOCKFILE /* how to declare __atribute__ ((__unused__)) */ #undef ATTR_UNUSED +/* whether they have __atttribute__ ((format(printf,...))) */ +#undef HAVE_PRINTFORMAT +#ifdef HAVE_PRINTFORMAT +#define ATTR_PRINTFORMAT(a,b) __attribute__ ((format(printf,(a),(b)))) +#else +#define ATTR_PRINTFORMAT(a,b) +#endif + @BOTTOM@ + +#ifndef DONT_NEED_DECLARATIONS + /* Declaration for gethostname(3)? */ #undef NEED_DECLARATION_GETHOSTNAME #ifdef NEED_DECLARATION_GETHOSTNAME @@ -99,17 +113,75 @@ char *strdup(const char *s); void usleep(unsigned long usec); #endif +/* Declaration for strcasecmp(3)? */ +#undef NEED_DECLARATION_STRCASECMP +#ifdef NEED_DECLARATION_STRCASECMP +#include +int strcasecmp(const char *s1, const char *s2); +#endif + +/* Declaration for siginterrupt(3)? */ +#undef NEED_DECLARATION_SIGINTERRUPT +#ifdef NEED_DECLARATION_SIGINTERRUPT +#include +int siginterrupt(int sig, int flag); +#endif + +/* Declaration for popen(3)? */ +#undef NEED_DECLARATION_POPEN +#ifdef NEED_DECLARATION_POPEN +#include +FILE *popen(const char *command, const char *type); +#endif + +/* Declaration for pclose(3)? */ +#undef NEED_DECLARATION_PCLOSE +#ifdef NEED_DECLARATION_PCLOSE +#include +int pclose(FILE *stream); +#endif + +#endif /* !DONT_NEED_DECLARATIONS */ + /* snprintf(3) unsafe emulation */ #ifdef HAVE_SNPRINTF -#define VARPRINTF(v,f,d) snprintf((v),sizeof((v)),f,(d)) +#define VARPRINTF(v,f,d) snprintf((v),sizeof((v)),f,(d) ) +#define VARPRINTF2(v,f,d1,d2) snprintf((v),sizeof((v)),f,(d1),(d2) ) +#define VARPRINTF5(v,f,d1,d2,d3,d4,d5) snprintf((v),sizeof((v)),f,(d1),(d2),(d3),(d4),(d5)) #else -#define VARPRINTF(v,f,d) sprintf((v),f,(d)) +#define VARPRINTF(v,f,d) sprintf((v),f,(d) ) +#define VARPRINTF2(v,f,d1,d2) sprintf((v),f,(d1),(d2) ) +#define VARPRINTF5(v,f,d1,d2,d3,d4,d5) sprintf((v),f,(d1),(d2),(d3),(d4),(d5)) #endif /* vsnprintf(3) unsafe emulation */ #ifdef HAVE_VSNPRINTF -#define VARVPRINTF(v,f,d) vsnprintf((v),sizeof((v)),f,(d)) +#define VARVPRINTF(v,f,d) vsnprintf((v),sizeof((v)),f,(d) ) +#define VARVPRINTF2(v,f,d1,d2) vsnprintf((v),sizeof((v)),f,(d1),(d2)) #else -#define VARVPRINTF(v,f,d) vsprintf((v),f,(d)) +#define VARVPRINTF(v,f,d) vsprintf((v),f,(d) ) +#define VARVPRINTF2(v,f,d1,d2) vsprintf((v),f,(d1),(d2)) +#endif + +#ifndef HAVE_STRERROR +extern char *sys_errlist[]; +#define strerror(i) sys_errlist[i] #endif +#ifndef HAVE_STRCHR +#define strchr index +#endif + +#ifndef HAVE_STRRCHR +#define strrchr rindex +#endif + +#ifdef HAVE_STRCASECMP +#define strtrycasecmp strcasecmp +#else +#define strtrycasecmp strcmp +#endif + +#ifndef HAVE_OFFSETOF +#define offsetof(a,b) ((size_t)&((a *)0)->b) +#endif