Skip to content

Commit

Permalink
Create strong typedefs for Win32 handler types for non-Windows OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamyCecil committed Aug 15, 2024
1 parent af67faa commit 92a979b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Sources/Engine/OS/PlatformTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef signed long int SLONG;
typedef long int RESULT; // For error codes
typedef long int INDEX; // For indexed values and quantities

#elif SE1_UNIX
#else

// 32-bit types
typedef unsigned int ULONG;
Expand Down Expand Up @@ -53,13 +53,15 @@ typedef void *LPVOID;

typedef UINT_PTR DWORD_PTR;

// [Cecil] TODO: Make sure these are properly used
typedef void *HWND;
typedef void *HANDLE;
typedef void *HINSTANCE;
typedef void *HMODULE;
typedef void *HDC;
typedef void *HGLRC;
// Win32-esque handler pointers
#define DECLARE_HANDLE(_Class) struct _Class##__ { int dummy; }; typedef struct _Class##__ *_Class

DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HANDLE);
DECLARE_HANDLE(HINSTANCE);
typedef HINSTANCE HMODULE;
DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HGLRC);

typedef struct {
LONG x;
Expand All @@ -86,6 +88,6 @@ typedef struct {

#define WAVE_FORMAT_PCM 0x0001

#endif // SE1_UNIX
#endif // !SE1_WIN

#endif // include-once check

0 comments on commit 92a979b

Please sign in to comment.