/* config.h. Generated by cmake from config.h.cmake */

/**
SPDX-FileCopyrightText: Allen Winter <winter@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
*/

/* Define if you have the ICU library. */
/* #undef HAVE_LIBICU */

/* Define if you have the Berkeley DB library. */
/* #undef HAVE_BDB */

/* Define to 1 if you have the `backtrace' function. */
#define HAVE_BACKTRACE 1

/* Define to 1 if you have the <byteswap.h> header file. */
/* #undef HAVE_BYTESWAP_H */

/* Define to 1 if you have the <endian.h> header file. */
/* #undef HAVE_ENDIAN_H */

/* Define to 1 if you have the `GetNumberFormat' function. */
/* #undef HAVE_GETNUMBERFORMAT */

/* Define to 1 if you have the `gmtime_r' function. */
#define HAVE_GMTIME_R 1

/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have type 'intptr_t' defined. */
/* #undef HAVE_INTPTR_T */

/* Define to 1 if you have the `iswspace' function. */
#define HAVE_ISWSPACE 1

/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1

/* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1

/* Define if we have pthread. */
/* #undef HAVE_PTHREAD_ATTR_GET_NP */
/* #undef HAVE_PTHREAD_GETATTR_NP */
#define HAVE_PTHREAD_CREATE 1
/* #undef HAVE_PTHREAD_NP_H */
#if defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_CREATE) || defined(HAVE_PTHREAD_NP_H)
#define HAVE_PTHREAD 1
#endif

/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1

/* Define to 1 if you have the `nanosleep' function. */
#define HAVE_NANOSLEEP 1

/* Define to 1 if you have the `usleep' function. */
#define HAVE_USLEEP 1

/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1

/* Define to 1 if you have the `_snprintf' function. */
/* #undef HAVE__SNPRINTF */

/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1

/* Define to 1 if you have the `_stat' function. */
/* #undef HAVE__STAT */

/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1

/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1

/* Define to 1 if you have the `_stricmp' function. */
/* #undef HAVE__STRICMP */

/* Define to 1 if you have the `_strnicmp' function. */
/* #undef HAVE__STRNICMP */

/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1

/* Define to 1 if you have the `_strdup' function. */
/* #undef HAVE__STRDUP */

/* Define to 1 if you have the `access' function. */
#define HAVE_ACCESS 1

/* Define to 1 if you have the `_access' function. */
/* #undef HAVE__ACCESS */

/* Define to 1 if you have the `getopt' function. */
#define HAVE_GETOPT 1

/* Define to 1 if you have the `getpid' function. */
#define HAVE_GETPID 1

/* Define to 1 if you have the `_getpid' function. */
/* #undef HAVE__GETPID */

/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1

/* Define to 1 if you have the `_mkdir' function. */
/* #undef HAVE__MKDIR */

/* Define to 1 if you have the `open' function. */
#define HAVE_OPEN 1

/* Define to 1 if you have the `_open' function. */
/* #undef HAVE__OPEN */

/* Define to 1 if you have the `read' function. */
#define HAVE_READ 1

/* Define to 1 if you have the `_read' function. */
/* #undef HAVE__READ */

/* Define to 1 if you have the `write' function. */
#define HAVE_WRITE 1

/* Define to 1 if you have the `_write' function. */
/* #undef HAVE__WRITE */

/* Define to 1 if you have the <sys/endian.h> header file. */
/* #undef HAVE_SYS_ENDIAN_H */

/* Define to 1 if you have the `setenv' function. */
#define HAVE_SETENV 1

/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1

/* Define to 1 if you have the <sys/utsname.h> header file. */
#define HAVE_SYS_UTSNAME_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1

/* Define to 1 if you have the `unsetenv' function. */
#define HAVE_UNSETENV 1

/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1

/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1

/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1

/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1

/* Define to 1 if you have the `getpwent' function. */
#define HAVE_GETPWENT 1

/* Define to 1 if you have the `unlink' function. */
#define HAVE_UNLINK 1

/* Define to 1 if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1

/* Define to make icalerror_* calls abort instead of internally signalling an
   error */
#define ICAL_ERRORS_ARE_FATAL 0

/* Define to prevent empty properties from being replaced with X-LIC-ERROR properties */
#define ICAL_ALLOW_EMPTY_PROPERTIES 0

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://libical.github.io/libical/"

/* Define to the full name of this package. */
#define PACKAGE_NAME "libical"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libical 3.1"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libical"

/* Define to the version of this package. */
#define PACKAGE_VERSION "3.1"

/* whether we should bring our own TZ-Data */
#define USE_BUILTIN_TZDATA

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Typedef intptr_t if needed */
#define HAVE_SIZEOF_INTPTR_T 1
#if !defined(HAVE_SIZEOF_INTPTR_T)
typedef unsigned int inptr_t;
#endif

/* Typedef size_t if needed */
#define HAVE_SIZEOF_SIZE_T
#if !defined(HAVE_SIZEOF_SIZE_T)
typedef unsigned long size_t;
#endif

/* Typedef ssize_t if needed */
#define HAVE_SIZEOF_SSIZE_T
#if !defined(HAVE_SIZEOF_SSIZE_T)
#if !defined(HAVE_BDB) && !defined(_WIN32)
typedef long ssize_t;
#endif
#endif

/* Typedef pid_t if needed */
#define HAVE_SIZEOF_PID_T 1
#if !defined(HAVE_SIZEOF_PID_T)
typedef int pid_t;
#endif

/* Typedef wint_t if needed */
/* #undef HAVE_SIZEOF_WINT_T */
#if !defined(HAVE_SIZEOF_WINT_T)
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
#else
typedef unsigned int wint_t;
#endif
#endif

#define SIZEOF_TIME_T 8
#define SIZEOF_ICALTIME_T 8

/* whether we have ICU DANGI calendar */
/* #undef HAVE_ICU_DANGI */

/* getpwent - function to get password file entry */
#if defined(HAVE_GETPWENT)
#include <sys/types.h>
#include <pwd.h>
#endif

/* strcasecmp or stricmp: String compare, case independent */
#if defined(HAVE__STRICMP)
#define strcasecmp _stricmp
#include <string.h>
#else
#if !defined(HAVE_STRCASECMP)
#error "No case independent string compare function available"
#else
#include <strings.h>
#endif
#endif

/* strncasecmp or strnicmp: String compare, case independent, size limited */
#if defined(HAVE__STRICMP)
#define strncasecmp _strnicmp
#include <string.h>
#else
#if !defined(HAVE_STRNCASECMP)
#error "No case independent string compare size limited function available"
#else
#include <strings.h>
#endif
#endif

/* snprintf: size limited sprintf */
#if defined(HAVE__SNPRINTF)
#define snprintf _snprintf
#else
#if !defined(HAVE_SNPRINTF)
#error "No size limited sprintf available"
#endif
#endif
#include <stdio.h>

/* sleep: function to sleep for a specified time */
#if defined(_WIN32)
#include <windows.h>
#if defined(sleep)
#undef sleep
#endif
#define sleep(n) (Sleep((n)*1000))
#else
#include <unistd.h>
#endif

/* nanosleep: function for high resolution sleeping */
#if defined(HAVE_NANOSLEEP)
#include <time.h>
#endif

/* usleep: deprecated, but useful if nanosleep is unavailable */
#if defined(HAVE_USLEEP)
#include <unistd.h>
#endif

#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_USLEEP)
#if !defined(_WIN32)
#error "No function for high resolution timing available"
#endif
#endif

/* stat: function to get status info on a file */
#if defined(HAVE__STAT)
#define stat _stat
#else
#if !defined(HAVE_STAT)
#error "No function to get status info on a file available"
#endif
#endif
#include <sys/types.h>
#include <sys/stat.h>

/* strdup: function to duplicate a string */
#if defined(HAVE__STRDUP)
#define strdup _strdup
#else
#if !defined(HAVE_STRDUP)
#error "No duplicate a string function available"
#endif
#endif
#include <string.h>

/* iswspace: whitespace wide character function */
#if !defined(HAVE_ISWSPACE)
#include <ctype.h>
#define iswspace isspace
#else
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
#else
#include <ctype>
#endif
#endif

/* access - system function to check user file permissions */
#if defined(HAVE__ACCESS)
#include <io.h>
#define access _access
#else
#if !defined(HAVE_ACCESS)
#error "No check user file access function available"
#else
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif
#endif

/* getopt - function to parse command-line options */
#if defined(HAVE_GETOPT)
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#else
#if !defined(_WIN32)
#error "No parse command-line function available"
#endif
#endif

/* getpid - system function to get process identification */
#if defined(HAVE__GETPID)
#include <process.h>
#define getpid _getpid
#else
#if !defined(HAVE_GETPID)
#error "No get process identification function available"
#else
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif
#endif

/* mkdir - system function to create a directory */
#if defined(HAVE__MKDIR)
#include <direct.h>
#define mkdir(path, mode) _mkdir(path)
#else
#if !defined(HAVE_MKDIR)
#error "No create directory system function available"
#else
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__MINGW32__) || defined(__MINGW64__)
#define mkdir(path, mode) mkdir(path)
#endif
#endif
#endif

/* open - system function to open a file */
#if defined(HAVE__OPEN)
#include <io.h>
#define open _open
#else
#if !defined(HAVE_OPEN)
#error "No open file system function available"
#endif
#endif
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif

/* read - system function to read from a file descriptor */
#if defined(HAVE__READ)
#include <io.h>
#define read _read
#else
#if !defined(HAVE_READ)
#error "No read from file descriptor system function available"
#else
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif
#endif

/* write - system function to write to a file descriptor */
#if defined(HAVE__WRITE)
#include <io.h>
#define write _write
#else
#if !defined(HAVE_WRITE)
#error "No write to file descriptor system function available"
#else
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif
#endif

#if defined(_MSC_VER)
typedef int IO_SIZE_T;
typedef unsigned int IO_SSIZE_T;
#else
typedef size_t IO_SIZE_T;
typedef ssize_t IO_SSIZE_T;
#endif

#if defined(_MSC_VER)
#if !defined(F_OK) /* file exists */
#define F_OK 0
#endif
#if !defined(W_OK) /* file has write permission */
#define W_OK 2
#endif
#if !defined(R_OK) /* file has read permission */
#define R_OK 4
#endif
#if !defined(X_OK) /* file has execute permission */
#define X_OK 6
#endif
#endif

#if defined(_MSC_VER)
#define _S_ISTYPE(mode, mask)  (((mode) & _S_IFMT) == (mask))
#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR)
#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG)
#endif

/* fork - system function to create a child process */
#if defined(HAVE_FORK)
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif

/* alarm - function to set and alarm for delivering a signal */
#if defined(HAVE_ALARM)
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif

/* signal - signal handling function */
#if defined(HAVE_SIGNAL)
#include <signal.h>
#endif

/* waitpid - system function waiting on a process */
#if defined(HAVE_WAITPID)
#include <sys/types.h>
#include <sys/wait.h>
#endif

/* unlink - system function to delete a file */
#if defined(HAVE_UNLINK)
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif

/* gmtime_r - thread safe gmtime() really only needed on Unix */
#include <time.h> /*define before possible mention of gmtime()*/
#if !defined(HAVE_GMTIME_R)
#if !defined(_WIN32)
#error "No thread-safe gmtime function available"
#endif
/*on Windows there might be a macro called gmtime_r in pthread.h. don't use it.*/
#if defined(gmtime_r)
#undef gmtime_r
#endif
/* FYI: The gmtime() in Microsoft's C library is MT-safe */
#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
#endif

/* localtime_r - thread safe localtime() really only needed on Unix */
#if !defined(HAVE_LOCALTIME_R)
#if !defined(_WIN32)
#error "No thread-safe localtime function available"
#endif
/*on Windows there might be a macro called localtime_r in pthread.h. don't use it.*/
#if defined(localtime_r)
#undef localtime_r
#endif
/* FYI: The localtime() in Microsoft's C library is MT-safe */
#define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
#endif

/*
 * Substitute functions for those from time.h but working with icaltime_t instead of time_t.
 */
/* #undef LIBICAL_ENABLE_64BIT_ICALTIME_T */
#if (defined(LIBICAL_ENABLE_64BIT_ICALTIME_T) && (SIZEOF_TIME_T != 8))
#if defined(_MSC_VER)
#define icaltime(timer) _time64(timer)
#define icalctime(timer) _ctime64(timer)
#define icalmktime(timeptr) _mktime64(timeptr)
#define icalgmtime_r(tp,tmp) (_gmtime64(tp)?(*(tmp)=*_gmtime64(tp),(tmp)):0)
#define icallocaltime_r(tp,tmp) (_localtime64(tp)?(*(tmp)=*_localtime64(tp),(tmp)):0)
#else
#error "This compiler is not supported together with the 'LIBICAL_ENABLE_64BIT_ICALTIME_T' option."
#endif
#else
#define icaltime(timer) time(timer)
#define icalctime(timer) ctime(timer)
#define icalmktime(timeptr) mktime(timeptr)
#define icalgmtime_r(timer, buf) gmtime_r(timer, buf)
#define icallocaltime_r(timer, buf) localtime_r(timer, buf)
#endif

/* define MAXPATHLEN */
#if defined(_WIN32)
#include <windows.h> //for MAX_PATH
#define MAXPATHLEN MAX_PATH
#else
#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h>
#endif
#endif
#if !defined(MAXPATHLEN)
#define MAXPATHLEN 1024
#endif

/* MIN macro */
#if !defined(MIN)
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif

/* Unused argument macro */
#if !defined(_unused)
#if defined(__LCLINT__) || defined(S_SPLINT_S)
#define _unused(x) x
#else
#define _unused(x) (void)x
#endif
#endif

#define icalassert(...) assert(__VA_ARGS__)
#define icalerrprintf(...) fprintf(stderr, __VA_ARGS__)

#define ICALMEMORY_DEFAULT_MALLOC malloc
#define ICALMEMORY_DEFAULT_REALLOC realloc
#define ICALMEMORY_DEFAULT_FREE free


/* #undef LIBICAL_SYNCMODE_THREADLOCAL */

#define ICAL_SYNC_MODE_NONE 1
#define ICAL_SYNC_MODE_PTHREAD 2
#define ICAL_SYNC_MODE_THREADLOCAL 3

#ifdef LIBICAL_SYNCMODE_THREADLOCAL
#define ICAL_SYNC_MODE ICAL_SYNC_MODE_THREADLOCAL
#elif HAVE_PTHREAD == 1
#define ICAL_SYNC_MODE ICAL_SYNC_MODE_PTHREAD
#else
#define ICAL_SYNC_MODE ICAL_SYNC_MODE_NONE
#endif

#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_THREADLOCAL
#if defined(_MSC_VER)
#define ICAL_GLOBAL_VAR __declspec(thread)
#endif
#if defined(__GNUC__)
#define ICAL_GLOBAL_VAR __thread
#endif
#ifndef ICAL_GLOBAL_VAR
/* thread_local has been introduced with C11. Starting with C23 it will become a keyword and
   we won't need to include threads.h then. */
#include <threads.h>
#define ICAL_GLOBAL_VAR thread_local
#endif
#else
#define ICAL_GLOBAL_VAR
#endif
