Skip to content

Commit

Permalink
fix windows: ensure correct include order
Browse files Browse the repository at this point in the history
- stdafx.h needs to be first
- windows.h before winuser.h

Fixes this error on Windows:
fatal  error C1189: #error:  "No Target Architecture"
  • Loading branch information
bkueng committed Dec 18, 2023
1 parent d49ab8e commit cf2bf90
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion include/3rdparty/VirtualKeyCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
*
*/

#include <WinUser.h>
// clang-format off
#include <windows.h>
#include <WinUser.h>
// clang-format on

#if _MSC_VER > 1600
enum class MouseButton
Expand Down
8 changes: 5 additions & 3 deletions src/3rdparty/InputBuilder.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "InputBuilder.h"
// clang-format off
#include "stdafx.h"
// clang-format on

#include <Windef.h>
#include "InputBuilder.h"

#include "stdafx.h"
#include <windows.h>

/* Copyright(c) 1998-2012, Arnaud Colin
* All rights reserved.
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/InputSimulator.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// clang-format off
#include "stdafx.h"
// clang-format on
#include "InputSimulator.h"

#include "KeyboardSimulator.h"
#include "MouseSimulator.h"
#include "WindowsInputDeviceStateAdaptor.h"
#include "stdafx.h"
/* Copyright(c) 1998-2012, Arnaud Colin
* All rights reserved.
*
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/KeyboardSimulator.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// clang-format off
#include "stdafx.h"
// clang-format on
#include "KeyboardSimulator.h"

#include "InputBuilder.h"
#include "stdafx.h"

/* Copyright(c) 1998-2012, Arnaud Colin
* All rights reserved.
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/MouseSimulator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// clang-format off
#include "stdafx.h"
// clang-format on
#include "MouseSimulator.h"

#include "stdafx.h"
/* Copyright(c) 1998-2012, Arnaud Colin
* All rights reserved.
*
Expand Down
4 changes: 3 additions & 1 deletion src/3rdparty/WindowsInputDeviceStateAdaptor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// clang-format off
#include "stdafx.h"
// clang-format on
#include "WindowsInputDeviceStateAdaptor.h"

#include "stdafx.h"
/* Copyright(c) 1998-2012, Arnaud Colin
* All rights reserved.
*
Expand Down

0 comments on commit cf2bf90

Please sign in to comment.