Skip to content

Commit

Permalink
Merge pull request #6 from gnustep/master
Browse files Browse the repository at this point in the history
sync the master
  • Loading branch information
onflapp authored Sep 23, 2024
2 parents ad732b4 + 4e3ca27 commit 9764dcd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Source/win32/WIN32Server.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@

#include <math.h>

// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
// type to avoid this clash. When compiling natively on Windows, we need to manually
// define WINBOOL.
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
// here.
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
#ifndef _DEF_WINBOOL_
#define _DEF_WINBOOL_
typedef int WINBOOL;
#endif

// To update the cursor..
static BOOL update_cursor = NO;
static BOOL should_handle_cursor = NO;
Expand Down
12 changes: 12 additions & 0 deletions Source/win32/w32_windowdisplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
#include "win32/WIN32Server.h"
#include "win32/WIN32Geometry.h"

// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
// type to avoid this clash. When compiling natively on Windows, we need to manually
// define WINBOOL.
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
// here.
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
#ifndef _DEF_WINBOOL_
#define _DEF_WINBOOL_
typedef int WINBOOL;
#endif

static void
invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
{
Expand Down
8 changes: 7 additions & 1 deletion Source/x11/XIMInputServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,18 @@ - (NSString *) lookupStringForEvent: (XKeyEvent *)event
{
/* Always returns a Latin-1 string according to the manpage */
count = XLookupString (event, buf, BUF_LEN, &keysym, NULL);
if (count)
if (count == 1)
{
keys = [[[NSString alloc] initWithBytes: buf
length: count
encoding: NSISOLatin1StringEncoding] autorelease];
}
else if (count > 1) // manpage lies and we suppose UTF-8
{
keys = [[[NSString alloc] initWithBytes: buf
length: count
encoding: NSUTF8StringEncoding] autorelease];
}

if (keysymptr)
*keysymptr = keysym;
Expand Down
5 changes: 5 additions & 0 deletions Tools/gpbs.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@
#endif

#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#else
#include <io.h>
#define strcasecmp _stricmp
#endif
#include <ctype.h>

#ifdef __MINGW__
Expand Down
12 changes: 12 additions & 0 deletions Tools/win32pbs.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
#include <sys/file.h>
#endif

// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
// type to avoid this clash. When compiling natively on Windows, we need to manually
// define WINBOOL.
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
// here.
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
#ifndef _DEF_WINBOOL_
#define _DEF_WINBOOL_
typedef int WINBOOL;
#endif

@interface Win32PbOwner : NSObject
{
NSPasteboard *_pb;
Expand Down

0 comments on commit 9764dcd

Please sign in to comment.