1 /***************************************************************************
2 * Copyright (C) 2007 by Arep *
3 * Support is provided through the forums at *
4 * http://www.console-tribe.com *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20 ***************************************************************************/
23 /*** WINDOWS COMPATIBILITY STUFF ***/
29 /* Stuff to export library symbols */
30 #ifdef FRIIDUMPLIB_BUILD_DLL
31 #ifdef FRIIDUMPLIB_EXPORTS
32 #define FRIIDUMPLIB_EXPORT __declspec(dllexport) /* Building the lib */
34 #define FRIIDUMPLIB_EXPORT __declspec(dllimport) /* Building user code */
37 #define FRIIDUMPLIB_EXPORT
40 /* Definition of the types we use for Windows */
42 #define u_int16_t WORD
44 #define u_int32_t DWORD
46 #define u_int64_t ULONGLONG
47 typedef long suseconds_t;
49 /* Modern MSVC/UCRT provides snprintf; do not macro-alias it. */
50 #define strdup _strdup
51 #define strcasecmp lstrcmpi
53 #define va_copy(ap1, ap2) ((ap1) = (ap2)) /* MSVC compatibility */
56 /* Some functions do not exist (export them for applications, too) */
57 FRIIDUMPLIB_EXPORT char *strndup (const char *src, int c);
58 FRIIDUMPLIB_EXPORT int ftruncate (int fd, __int64 size);
59 FRIIDUMPLIB_EXPORT int gettimeofday(struct timeval *tv, struct timezone *tz);
61 /* Windows does have a different localtime() */
62 #define localtime_r(x, y) !localtime_s (y, x)
66 #define FRIIDUMPLIB_EXPORT