#ifdef WINDOWSNT
# include <windows.h>
+# include "w32common.h"
# include "w32.h"
DEF_DLL_FN (int, inflateInit2_,
# ifdef WINDOWSNT
# include <windows.h>
+# include "w32common.h"
# include "w32.h"
# endif
/* We need (or want) w32.h only when we're _not_ compiling for Cygwin. */
#ifdef WINDOWSNT
+# include "w32common.h"
# include "w32.h"
#endif
#ifdef WINDOWSNT
# include <windows.h>
+# include "w32common.h"
# include "w32.h"
DEF_DLL_FN (void, json_set_alloc_funcs,
#ifdef WINDOWSNT
# include <windows.h>
+# include "w32common.h"
# include "w32.h"
DEF_DLL_FN (cmsFloat64Number, cmsCIE2000DeltaE,
/* Return the string resource associated with KEY of type TYPE. */
extern LPBYTE w32_get_resource (const char * key, LPDWORD type);
-/* Load a function from a DLL. Defined in this file. */
-typedef void (* VOIDFNPTR) (void);
-INLINE VOIDFNPTR get_proc_addr (HINSTANCE handle, LPCSTR fname);
-
extern void release_listen_threads (void);
extern void init_ntproc (int);
extern void term_ntproc (int);
const void* buf, size_t sz);
#endif /* HAVE_GNUTLS */
-
-
-/* Load a function address from a DLL. Cast the result via "VOIDFNPTR"
- to pacify -Wcast-function-type in GCC 8.1. */
-INLINE VOIDFNPTR
-get_proc_addr (HINSTANCE handle, LPCSTR fname)
-{
- return (VOIDFNPTR) GetProcAddress (handle, fname);
-}
-
-/* Define a function that will be loaded from a DLL. The variable
- arguments should contain the argument list for the function, and
- optionally be followed by function attributes. For example:
- DEF_DLL_FN (void, png_longjmp, (png_structp, int) PNG_NORETURN);
- */
-#define DEF_DLL_FN(type, func, ...) \
- typedef type (CDECL *W32_PFN_##func) __VA_ARGS__; \
- static W32_PFN_##func fn_##func
-
-/* Load a function from the DLL. */
-#define LOAD_DLL_FN(lib, func) \
- do \
- { \
- fn_##func = (W32_PFN_##func) get_proc_addr (lib, #func); \
- if (!fn_##func) \
- return false; \
- } \
- while (false)
-
#endif /* EMACS_W32_H */
/* Cache system info, e.g., the NT page size. */
extern void cache_system_info (void);
+typedef void (* VOIDFNPTR) (void);
+
+/* Load a function address from a DLL. Cast the result via VOIDFNPTR
+ to pacify -Wcast-function-type in GCC 8.1. The return value must
+ be cast to the correct function pointer type. */
+INLINE VOIDFNPTR
+get_proc_addr (HINSTANCE handle, LPCSTR fname)
+{
+ return (VOIDFNPTR) GetProcAddress (handle, fname);
+}
+
+/* Define a function that will be loaded from a DLL. The variable
+ arguments should contain the argument list for the function, and
+ optionally be followed by function attributes. For example:
+ DEF_DLL_FN (void, png_longjmp, (png_structp, int) PNG_NORETURN);
+ */
+#define DEF_DLL_FN(type, func, ...) \
+ typedef type (CDECL *W32_PFN_##func) __VA_ARGS__; \
+ static W32_PFN_##func fn_##func
+
+/* Load a function from the DLL. */
+#define LOAD_DLL_FN(lib, func) \
+ do \
+ { \
+ fn_##func = (W32_PFN_##func) get_proc_addr (lib, #func); \
+ if (!fn_##func) \
+ return false; \
+ } \
+ while (false)
+
#endif /* W32COMMON_H */
#include "coding.h" /* for ENCODE_SYSTEM, DECODE_SYSTEM */
#include "w32font.h"
#ifdef WINDOWSNT
+#include "w32common.h"
#include "w32.h"
#endif
#include "composite.h"
#include "font.h"
#include "w32font.h"
+#include "w32common.h"
struct uniscribe_font_info
{
#ifdef WINDOWSNT
# include <windows.h>
+# include "w32common.h"
# include "w32.h"
DEF_DLL_FN (htmlDocPtr, htmlReadMemory,