[BACK]Return to config.h.post CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / Attic / config.h.post (download)

Revision 1.11, Tue Aug 5 12:50:52 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.10: +3 -0 lines

Since old SQLite versions do not have sqlite3_errstr(),
provide a dummy fallback implementation.
Do not bother to decode the error, SQLite error codes
are not useful enough for that to be worthwhile.
Note that using sqlite3_errmsg(db) would be a bad idea:
On malloc() failure, db is NULL, which would cause a segfault.
Issue noticed by kristaps@.

#if !defined(__BEGIN_DECLS)
#  ifdef __cplusplus
#  define	__BEGIN_DECLS		extern "C" {
#  else
#  define	__BEGIN_DECLS
#  endif
#endif
#if !defined(__END_DECLS)
#  ifdef __cplusplus
#  define	__END_DECLS		}
#  else
#  define	__END_DECLS
#  endif
#endif

#ifndef HAVE_FGETLN
extern	char	 *fgetln(FILE *, size_t *);
#endif
#ifndef HAVE_GETSUBOPT
extern	int	  getsubopt(char **, char * const *, char **);
extern	char	 *suboptarg;
#endif
#ifndef HAVE_REALLOCARRAY
extern	void	 *reallocarray(void *, size_t, size_t);
#endif
#ifndef HAVE_SQLITE3_ERRSTR
extern	const char *sqlite3_errstr(int);
#endif
#ifndef HAVE_STRCASESTR
extern	char	 *strcasestr(const char *, const char *);
#endif
#ifndef HAVE_STRLCAT
extern	size_t	  strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
extern	size_t	  strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
extern	char	 *strsep(char **, const char *);
#endif

#endif /* MANDOC_CONFIG_H */