-1

Just want to start by saying thank you for taking the time to look at my problem.

Below is the code that is giving me the error:

// INFO(Tanner): XInputGetState Support
#define X_INPUT_GET_STATE(name) DWORD WINAPI name(DWORD dwUserIndex, XINPUT_STATE* pState);
typedef X_INPUT_GET_STATE(x_input_get_state);

X_INPUT_GET_STATE(XInputGetStateStub)
{
    return(ERROR_DEVICE_NOT_CONNECTED);
}
global_variable x_input_get_state* XInputGetState_ = XInputGetStateStub;
#define XInputGetState XInputGetState_


// INFO(Tanner): XInputSetState Support
#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(0);
}
global_variable x_input_set_state* XInputSetState_ = XInputSetStateStub;
#define XInputSetState XInputSetState_

The problem accoring to the compiler is that I don't have the open currly brace "{" for my XInputGetStateStub and XInputSetStateStub.

Any help is appriciated!

Blastfurnace
  • 18,411
  • 56
  • 55
  • 70
BornGeek
  • 58
  • 1
  • 9

1 Answers1

1

Your code will preprocess to the following:

typedef DWORD WINAPI x_input_get_state(DWORD dwUserIndex, XINPUT_STATE* pState);;

DWORD WINAPI XInputGetStateStub(DWORD dwUserIndex, XINPUT_STATE* pState);
{
    return(ERROR_DEVICE_NOT_CONNECTED);
}
global_variable x_input_get_state* XInputGetState_ = XInputGetStateStub;

typedef DWORD WINAPI x_input_set_state(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration);;

DWORD WINAPI XInputSetStateStub(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration);
{
    return(0);
}
global_variable x_input_set_state* XInputSetState_ = XInputSetStateStub;

As you can see there is an extra ; after the DWORD WINAPI XInputSetStateStub(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) due to #define ending with a ;. Remove that, and see if it works or not.

Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
  • Thank you, I should probably go to bed now. Missing that obvious of a mistake...twice, at least I got a lot of work done in the last 12 hours. Thank you again. – BornGeek Aug 17 '20 at 07:33