wine/library/errno.c
Alexandre Julliard 598412ed6a Cleaned up the various errno location tests in configure.
Added (h_)errno_location pointers in the library that allow remapping
the calls in higher level dlls.
Moved X11DRV_CritSection out of sysdeps.c and into x11drv.dll.
2001-01-17 20:22:22 +00:00

46 lines
1 KiB
C

/*
* Wine library reentrant errno support
*
* Copyright 1998 Alexandre Julliard
*/
/* Get pointers to the static errno and h_errno variables used by Xlib. This
must be done before including <errno.h> makes the variables invisible. */
static int *default_errno_location(void)
{
extern int errno;
return &errno;
}
static int *default_h_errno_location(void)
{
extern int h_errno;
return &h_errno;
}
int* (*wine_errno_location)(void) = default_errno_location;
int* (*wine_h_errno_location)(void) = default_h_errno_location;
#include "config.h"
/***********************************************************************
* __errno_location/__error/___errno
*
* Get the per-thread errno location.
*/
#ifdef ERRNO_LOCATION
int *ERRNO_LOCATION(void)
{
return wine_errno_location();
}
#endif /* ERRNO_LOCATION */
/***********************************************************************
* __h_errno_location
*
* Get the per-thread h_errno location.
*/
int *__h_errno_location(void)
{
return wine_h_errno_location();
}