TooTallNate / node-speaker

Output PCM audio data to the speakers
650 stars 147 forks source link

Doesn't compile on Visual Studio 2015 Update 3 : '__pfnDliNotifyHook2': redefinition; different type modifiers #81

Closed draeron closed 4 years ago

draeron commented 8 years ago

Copy paste from MS's delayimp.h header

// Prior to Visual Studio 2015 Update 3, these hooks were non-const.  They were
// made const to improve security (global, writable function pointers are bad).
// If for backwards compatibility you require the hooks to be writable, define
// the macro DELAYIMP_INSECURE_WRITABLE_HOOKS prior to including this header and
// provide your own non-const definition of the hooks.

This result in the following error :

win_delay_load_hook.c(35): error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers

Solution, just add the define DELAYIMP_INSECURE_WRITABLE_HOOKS in win_delay_load_hook.c

#define DELAYIMP_INSECURE_WRITABLE_HOOKS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include <delayimp.h>
#include <string.h>