1999-11-13 23:23:35 +01:00
|
|
|
/*
|
|
|
|
* Wine porting definitions
|
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* Copyright 1996 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1999-11-13 23:23:35 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_WINE_PORT_H
|
|
|
|
#define __WINE_WINE_PORT_H
|
|
|
|
|
2002-04-26 21:05:15 +02:00
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
2001-07-26 23:43:29 +02:00
|
|
|
|
2007-05-22 18:12:05 +02:00
|
|
|
#ifdef __WINE_BASETSD_H
|
|
|
|
# error You must include port.h before all other headers
|
|
|
|
#endif
|
|
|
|
|
2001-05-16 21:45:34 +02:00
|
|
|
#include <fcntl.h>
|
2003-07-15 22:45:49 +02:00
|
|
|
#include <math.h>
|
1999-11-13 23:23:35 +01:00
|
|
|
#include <sys/types.h>
|
2000-12-06 21:20:11 +01:00
|
|
|
#include <sys/stat.h>
|
2002-03-11 06:08:38 +01:00
|
|
|
#include <string.h>
|
2013-01-08 22:06:25 +01:00
|
|
|
#include <stdlib.h>
|
2002-03-11 06:08:38 +01:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
1999-11-13 23:23:35 +01:00
|
|
|
|
|
|
|
|
2019-03-13 17:05:06 +01:00
|
|
|
/****************************************************************
|
|
|
|
* Hard-coded values for the Windows platform
|
|
|
|
*/
|
|
|
|
|
2019-12-16 11:59:46 +01:00
|
|
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
2019-03-13 17:05:06 +01:00
|
|
|
|
|
|
|
#include <direct.h>
|
2021-10-06 10:17:54 +02:00
|
|
|
#include <errno.h>
|
2019-03-13 17:05:06 +01:00
|
|
|
#include <io.h>
|
|
|
|
#include <process.h>
|
|
|
|
|
2020-04-06 11:43:55 +02:00
|
|
|
static inline void *dlopen(const char *name, int flags) { return NULL; }
|
|
|
|
static inline void *dlsym(void *handle, const char *name) { return NULL; }
|
|
|
|
static inline int dlclose(void *handle) { return 0; }
|
|
|
|
static inline const char *dlerror(void) { return "No dlopen support on Windows"; }
|
2021-10-06 10:17:54 +02:00
|
|
|
static inline int symlink(const char *from, const char *to) { errno = ENOSYS; return -1; }
|
2020-04-06 11:43:55 +02:00
|
|
|
|
2019-03-13 17:12:36 +01:00
|
|
|
#ifdef _MSC_VER
|
2019-11-17 13:43:14 +01:00
|
|
|
/* The UCRT headers in the Windows SDK #error out if we #define snprintf.
|
|
|
|
* The C headers that came with previous Visual Studio versions do not have
|
|
|
|
* snprintf. Check for VS 2015, which appears to be the first version to
|
|
|
|
* use the UCRT headers by default. */
|
|
|
|
#if _MSC_VER < 1900
|
|
|
|
# define snprintf _snprintf
|
|
|
|
#endif
|
2007-02-02 15:35:15 +01:00
|
|
|
#endif
|
|
|
|
|
2019-03-13 17:12:36 +01:00
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
2002-04-26 21:05:15 +02:00
|
|
|
/****************************************************************
|
|
|
|
* Macro definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_DLFCN_H
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#else
|
|
|
|
#define RTLD_LAZY 0x001
|
|
|
|
#define RTLD_NOW 0x002
|
|
|
|
#define RTLD_GLOBAL 0x100
|
|
|
|
#endif
|
|
|
|
|
2003-07-15 22:45:49 +02:00
|
|
|
/****************************************************************
|
|
|
|
* Constants
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef M_PI
|
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef M_PI_2
|
|
|
|
#define M_PI_2 1.570796326794896619
|
|
|
|
#endif
|
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
#endif /* !defined(__WINE_WINE_PORT_H) */
|