aboutsummaryrefslogtreecommitdiffhomepage
path: root/compat/compat.h
Commit message (Collapse)AuthorAge
* compat: add canonicalize_file_nameGravatar David Bremner2014-04-08
| | | | | | | | the POSIX 2008 behaviour of realpath is not available everywhere so we provide a simple wrapper function. We use (and provide) the gnu extension canonicalize_file_name to make it cleaner to test for the feature we need; otherwise we have to rely on realpath segfaulting if the second argument is null.
* timegm: add portable implementation (Solaris support)Gravatar Blake Jones2013-08-23
| | | | | | | | | | The timegm(3) function is a non-standard extension to libc which is available in GNU libc and on some BSDs. Although SunOS had this function in its libc, Solaris (unfortunately) removed it. This patch implements a very simple version of timegm() which is good enough for parse-time-string.c. Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
* strsep: check for availability (Solaris support)Gravatar Blake Jones2013-08-23
| | | | | | | | | | Solaris does not ship a version of the strsep() function. This change adds a check to "configure" to see whether notmuch needs to provide its own implementation, and if so, it uses the new version in "compat/strsep.c" (which was copied from Mutt, and apparently before that from glibc). Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
* asctime: check for standards compliance (Solaris support)Gravatar Vladimir Marek2013-08-23
| | | | | | | | | | | | | | Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs to be defined to get the right number of arguments in the prototypes for asctime_r(). Solaris' default implementation conforms to POSIX.1c Draft 6, rather than the final POSIX.1c spec. The standards-compliant version can be used by defining _POSIX_PTHREAD_SEMANTICS. This change also adds the file "compat/check_asctime.c", which configure uses to perform its check, and modifies compat/compat.h to define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed. Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
* getpwuid: check for standards compliance (Solaris support)Gravatar Blake Jones2013-08-23
| | | | | | | | | | | | | | Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs to be defined to get the right number of arguments in the prototypes for getpwuid_r(). Solaris' default implementation conforms to POSIX.1c Draft 6, rather than the final POSIX.1c spec. The standards-compliant version can be used by defining _POSIX_PTHREAD_SEMANTICS. This change also adds the file "compat/check_getpwuid.c", which configure uses to perform its check, and modifies compat/compat.h to define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed. Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
* Silence buildbot warnings about unused resultsGravatar Austin Clements2012-01-21
| | | | | | | | | | | This ignores the results of the two writes in sigint handlers even harder than before. While my libc lacks the declarations that trigger these warnings, this can be tested by adding the following to notmuch.h: __attribute__((warn_unused_result)) ssize_t write(int fd, const void *buf, size_t count);
* Wrap the compat header in extern "C" { } when compiling C++ sourcesGravatar Tomas Carnecky2010-04-27
| | | | | | This fixes a build error on OpenSolaris where the final liking of notmuch fails because the linker can't find strcasestr() referenced from thread.cc.
* Add simplistic reimplementation of strcasestr to compat libraryGravatar Dirk Hohndel2010-04-14
| | | | | | | | | | While all systems that I have access to support strcasestr, it is in fact not part of POSIX. So here's a fallback reimplementation based on POSIX functions. Signed-off-by: Dirk Hohndel <hohndel@infradead.org> Tested-by: Tomas Carnecky <tom@dbservice.com> (on OpenSolaris snv_134)
* compat: Change includes from config.h to compat.h.Gravatar Carl Worth2009-12-01
We may switch to using an autoconf-like config.h, but we're not doing that just yet.