PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
mingwcompat.c File Reference
#include "postgres.h"
Include dependency graph for mingwcompat.c:

Go to the source code of this file.

Functions

static void LoadKernel32 ()
 
 typedef (PHANDLE, HANDLE, WAITORTIMERCALLBACK, PVOID, ULONG, ULONG)
 
BOOL WINAPI RegisterWaitForSingleObject (PHANDLE phNewWaitObject, HANDLE hObject, WAITORTIMERCALLBACK Callback, PVOID Context, ULONG dwMilliseconds, ULONG dwFlags)
 

Variables

const struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}
 
static HMODULE kernel32 = NULL
 
static
__RegisterWaitForSingleObject 
_RegisterWaitForSingleObject = NULL
 

Function Documentation

static void LoadKernel32 ( )
static

Definition at line 37 of file mingwcompat.c.

References ereport, errmsg_internal(), FATAL, kernel32, and NULL.

Referenced by RegisterWaitForSingleObject().

38 {
39  if (kernel32 != NULL)
40  return;
41 
42  kernel32 = LoadLibraryEx("kernel32.dll", NULL, 0);
43  if (kernel32 == NULL)
44  ereport(FATAL,
45  (errmsg_internal("could not load kernel32.dll: error code %lu",
46  GetLastError())));
47 }
#define FATAL
Definition: elog.h:52
#define ereport(elevel, rest)
Definition: elog.h:122
int errmsg_internal(const char *fmt,...)
Definition: elog.c:827
#define NULL
Definition: c.h:226
static HMODULE kernel32
Definition: mingwcompat.c:30
BOOL WINAPI RegisterWaitForSingleObject ( PHANDLE  phNewWaitObject,
HANDLE  hObject,
WAITORTIMERCALLBACK  Callback,
PVOID  Context,
ULONG  dwMilliseconds,
ULONG  dwFlags 
)

Definition at line 60 of file mingwcompat.c.

References _RegisterWaitForSingleObject, ereport, errmsg_internal(), FATAL, kernel32, LoadKernel32(), and NULL.

66 {
68  {
69  LoadKernel32();
70 
71  _RegisterWaitForSingleObject = (__RegisterWaitForSingleObject)
72  GetProcAddress(kernel32, "RegisterWaitForSingleObject");
73 
75  ereport(FATAL,
76  (errmsg_internal("could not locate RegisterWaitForSingleObject in kernel32.dll: error code %lu",
77  GetLastError())));
78  }
79 
81  (phNewWaitObject, hObject, Callback, Context, dwMilliseconds, dwFlags);
82 }
static void LoadKernel32()
Definition: mingwcompat.c:37
static __RegisterWaitForSingleObject _RegisterWaitForSingleObject
Definition: mingwcompat.c:57
#define FATAL
Definition: elog.h:52
#define ereport(elevel, rest)
Definition: elog.h:122
int errmsg_internal(const char *fmt,...)
Definition: elog.c:827
#define NULL
Definition: c.h:226
static HMODULE kernel32
Definition: mingwcompat.c:30
typedef ( PHANDLE  ,
HANDLE  ,
WAITORTIMERCALLBACK  ,
PVOID  ,
ULONG  ,
ULONG   
)

Variable Documentation

__RegisterWaitForSingleObject _RegisterWaitForSingleObject = NULL
static

Definition at line 57 of file mingwcompat.c.

Referenced by RegisterWaitForSingleObject().

const struct in6_addr in6addr_any = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}

Definition at line 22 of file mingwcompat.c.

Referenced by CheckRADIUSAuth().

HMODULE kernel32 = NULL
static

Definition at line 30 of file mingwcompat.c.

Referenced by LoadKernel32(), and RegisterWaitForSingleObject().