| 1 |
// ---------------------------------------------------------------------------- |
| 2 |
// Copyright (C) 2014 |
| 3 |
// David Freese, W1HKJ |
| 4 |
// |
| 5 |
// This file is part of flmsg |
| 6 |
// |
| 7 |
// flrig is free software; you can redistribute it and/or modify |
| 8 |
// it under the terms of the GNU General Public License as published by |
| 9 |
// the Free Software Foundation; either version 3 of the License, or |
| 10 |
// (at your option) any later version. |
| 11 |
// |
| 12 |
// flrig is distributed in the hope that it will be useful, |
| 13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
// GNU General Public License for more details. |
| 16 |
// |
| 17 |
// You should have received a copy of the GNU General Public License |
| 18 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
// ---------------------------------------------------------------------------- |
| 20 |
|
| 21 |
#ifndef COMPAT_H |
| 22 |
#define COMPAT_H |
| 23 |
|
| 24 |
/* adapted from compat.h in git-1.6.1.2 */ |
| 25 |
|
| 26 |
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) |
| 27 |
# define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ |
| 28 |
# define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ |
| 29 |
#endif |
| 30 |
#define _ALL_SOURCE 1 |
| 31 |
#define _GNU_SOURCE 1 |
| 32 |
#define _BSD_SOURCE 1 |
| 33 |
|
| 34 |
|
| 35 |
#include <config.h> |
| 36 |
|
| 37 |
#include <unistd.h> |
| 38 |
#include <stdio.h> |
| 39 |
#include <sys/stat.h> |
| 40 |
#include <fcntl.h> |
| 41 |
#include <stddef.h> |
| 42 |
#include <stdlib.h> |
| 43 |
#include <stdarg.h> |
| 44 |
#include <string.h> |
| 45 |
#include <errno.h> |
| 46 |
#include <limits.h> |
| 47 |
#include <sys/param.h> |
| 48 |
#include <sys/types.h> |
| 49 |
#include <sys/time.h> |
| 50 |
#include <time.h> |
| 51 |
#include <signal.h> |
| 52 |
#include <assert.h> |
| 53 |
|
| 54 |
#include "compat-mingw.h" |
| 55 |
|
| 56 |
#ifdef __MINGW32__ |
| 57 |
# if FLDIGI_FLTK_API_MAJOR == 1 && FLDIGI_FLTK_API_MINOR < 3 |
| 58 |
# undef dirent |
| 59 |
# include <dirent.h> |
| 60 |
# else |
| 61 |
# include <dirent.h> |
| 62 |
# endif |
| 63 |
#define WSA_MAJOR 2 |
| 64 |
#define WSA_MINOR 0 |
| 65 |
#else |
| 66 |
# include <dirent.h> |
| 67 |
#endif |
| 68 |
|
| 69 |
#ifdef __cplusplus |
| 70 |
extern "C" { |
| 71 |
#endif |
| 72 |
|
| 73 |
#if SNPRINTF_RETURNS_BOGUS |
| 74 |
#define snprintf git_snprintf |
| 75 |
extern int git_snprintf(char *str, size_t maxsize, |
| 76 |
const char *format, ...); |
| 77 |
#define vsnprintf git_vsnprintf |
| 78 |
extern int git_vsnprintf(char *str, size_t maxsize, |
| 79 |
const char *format, va_list ap); |
| 80 |
#endif |
| 81 |
|
| 82 |
#ifdef __cplusplus |
| 83 |
} |
| 84 |
#endif |
| 85 |
|
| 86 |
#endif // MINGW32_H |