I'd like for someone to explain me how the #define and typedef etc work for the function pointers Casey makes.
Here's the code I'm talking about:
1 2 3 4 5 6 | #define X_INPUT_SET_STATE(name) DWORD WINAPI name(DWORD dwUserIndex, XINPUT_VIBRATION *pVibration) typedef X_INPUT_SET_STATE(x_input_set_state); X_INPUT_SET_STATE(XInputSetStateStub) { return(ERROR_DEVICE_NOT_CONNECTED); } |
He uses these a lot and I can't figure out how it works.
I know what both do separately (define and typedef) but I don't know how he makes them work together AND while adding the method with the stub.
I'm a C++ and C# programmer (recently graduated) and function pointers have been discussed briefly and I really like to know how it works. Casey's way of doing it does seem different from what I've seen before. Is there a specific idea behind his way?
Thanks in advance