/* helpers.h -- main header file */
/*
* This file is part of CliFM
*
* Copyright (C) 2016-2023, L. Abramovich <leo.clifm@outlook.com>
* All rights reserved.
* CliFM is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* CliFM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef HELPERS_H
#define HELPERS_H
#if (defined(__linux__) || defined(__CYGWIN__)) && !defined(_BE_POSIX)
# define _GNU_SOURCE
#elif defined(__sun)
# define BSD_COMP
#else
# define _POSIX_C_SOURCE 200809L
# define _DEFAULT_SOURCE
# if defined(__linux__) || defined(__CYGWIN__)
# define _XOPEN_SOURCE /* wcwidth() */
# endif
# if defined(__FreeBSD__) || defined(__DragonFly__)
# define _XOPEN_SOURCE
# define __XSI_VISIBLE 700
# define __BSD_VISIBLE 1
# endif
# ifdef __NetBSD__
# define _XOPEN_SOURCE
# define _NETBSD_SOURCE
# define __BSD_VISIBLE 1
# endif
# ifdef __OpenBSD__
# define _BSD_SOURCE
# endif
# ifdef __APPLE__
# define _DARWIN_C_SOURCE
# endif
#endif
/* Setting GLOB_BRACE to ZERO disables support for GLOB_BRACE if not
* available on current platform */
#if !defined(__TINYC__) && !defined(GLOB_BRACE)
# define GLOB_BRACE 0
#endif
#if defined(__CYGWIN__) && defined(_BE_POSIX) && !defined(GLOB_TILDE)
# define GLOB_TILDE 0
#endif
/* Support large files on ARM and 32-bit machines */
#if defined(__arm__) || defined(__i386__)
# define _FILE_OFFSET_B