Skip to content

Commit

Permalink
Merge pull request #202 from audetto/libwindows
Browse files Browse the repository at this point in the history
libwindows: remove many non needed declarations.
  • Loading branch information
audetto authored Dec 7, 2024
2 parents 114eae2 + 3609f77 commit a9ae3a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 64 deletions.
84 changes: 20 additions & 64 deletions source/linux/libwindows/wincompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ extern "C" {
#ifndef BASETYPES
#define BASETYPES
typedef uint32_t ULONG; // 32 bit long in VS
typedef ULONG *PULONG;
typedef uint16_t USHORT;
typedef unsigned char UCHAR;
typedef char *PSZ;
#endif /* !BASETYPES */

typedef int16_t INT16;
Expand All @@ -45,16 +43,14 @@ typedef uint16_t UINT16;
// we stick to VS's definition
// this is important when selecting the correct printf format specifier
#define __int64 long long int
typedef __int64 LONGLONG;
typedef unsigned __int64 UINT64;

typedef intptr_t INT_PTR;
typedef uintptr_t UINT_PTR;

typedef __int64 LONGLONG;

typedef uint32_t UINT32;
typedef uint8_t UINT8;
typedef int32_t INT32;


#define MAX_PATH 260

Expand All @@ -74,56 +70,25 @@ typedef int32_t INT32;
#define TRUE 1
#endif

#ifndef IN
#define IN
#endif

#ifndef OUT
#define OUT
#endif

#ifndef OPTIONAL
#define OPTIONAL
#endif

#undef far
#undef near
#undef pascal
#define FAR

#define far
#define near
#if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
#define pascal __stdcall
#else
#define pascal
#endif

#undef FAR
#undef NEAR
#define FAR far
#define NEAR near
#ifndef CONST
#define CONST const
#endif

typedef uint32_t DWORD;
typedef int32_t BOOL;
typedef unsigned int DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef uint16_t WORD;
typedef float FLOAT;
typedef BOOL near *PBOOL;
typedef BOOL far *LPBOOL;
typedef BYTE near *PBYTE;
typedef BYTE far *LPBYTE;
typedef WORD near *PWORD;
typedef WORD far *LPWORD;
typedef DWORD near *PDWORD;
typedef DWORD far *LPDWORD;
typedef void far *LPVOID;
typedef CONST void far *LPCVOID;

typedef int32_t INT;
typedef uint32_t UINT;
typedef unsigned short WORD;
typedef BOOL *LPBOOL;
typedef BYTE *LPBYTE;
typedef WORD *LPWORD;
typedef DWORD *LPDWORD;
typedef void *LPVOID;
typedef CONST void *LPCVOID;

typedef int INT;
typedef unsigned int UINT;

#define MAKEWORD(a, b) ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
#define MAKELONG(a, b) ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
Expand All @@ -140,8 +105,7 @@ typedef DWORD *LPCOLORREF;
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef int32_t /*long*/ LONG;
typedef SHORT *PSHORT;
typedef int /*long*/ LONG;
typedef LONG *PLONG;
typedef wchar_t WCHAR;

Expand All @@ -151,25 +115,18 @@ typedef uintptr_t ULONG_PTR;
typedef LONG_PTR LRESULT;
typedef ULONG_PTR DWORD_PTR;

typedef DWORD LCID, *PLCID;

typedef unsigned __int64 UINT64, *PUINT64;
typedef DWORD LCID;

//
// ANSI (Multi-byte Character) types
//
typedef CHAR *PCHAR;
typedef CHAR *LPCH, *PCH;

typedef CONST CHAR *LPCCH, *PCCH;
typedef CHAR *NPSTR;
typedef CHAR *LPSTR, *PSTR;
typedef CONST CHAR *LPCSTR, *PCSTR;
typedef CHAR *LPSTR;
typedef CONST CHAR *LPCSTR;

typedef LPSTR LPTCH, PTCH;
typedef LPSTR PTSTR, LPTSTR;
typedef LPCSTR LPCTSTR;
typedef LPSTR LP;

typedef WCHAR *LPWSTR;
typedef CONST WCHAR *LPCWSTR;
Expand All @@ -180,8 +137,7 @@ typedef CONST WCHAR *LPCWSTR;
// othwerise QTCreator does not show the values (i.e. string) while debugging
// it treats it as an array of bytes
#define TCHAR char
typedef TCHAR _TCHAR, *PTCHAR;
typedef unsigned char TBYTE , *PTBYTE ;
typedef TCHAR _TCHAR;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */

Expand Down
4 changes: 4 additions & 0 deletions source/linux/libwindows/windows.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#ifdef _WIN32
#error libwindows must not be used on Windows builds.
#endif

#include "wincompat.h"
#include "guiddef.h"
#include "winhandles.h"
Expand Down

0 comments on commit a9ae3a1

Please sign in to comment.