summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2024-11-12 14:41:01 +0200
committerEli Zaretskii <eliz@gnu.org>2024-11-12 14:41:01 +0200
commitb54fa15ffbb959e97ea0b77bfeb9ae412a63b4e8 (patch)
tree9b22b5eaa78159a774030478e72370bbcdce2fac /src
parent6ddbe8c7010485f6bca80b6e898610d5831eac60 (diff)
Fix Cygw32 build
* src/pdumper.c (dump_mm_heap_cb_release): Avoid NULL pointer dereference. * src/w32dwrite.c (INITGUID) [CYGWIN]: Don't define for Cygwin. * src/w32menu.c (w32_popup_dialog): Fix Cygw32 build. (Bug#74312)
Diffstat (limited to 'src')
-rw-r--r--src/pdumper.c11
-rw-r--r--src/w32dwrite.c4
-rw-r--r--src/w32menu.c5
3 files changed, 14 insertions, 6 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index c888b659dde..c0b36b1ca44 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4853,11 +4853,14 @@ struct dump_memory_map_heap_control_block
static void
dump_mm_heap_cb_release (struct dump_memory_map_heap_control_block *cb)
{
- eassert (cb->refcount > 0);
- if (--cb->refcount == 0)
+ if (cb)
{
- free (cb->mem);
- free (cb);
+ eassert (cb->refcount > 0);
+ if (--cb->refcount == 0)
+ {
+ free (cb->mem);
+ free (cb);
+ }
}
}
diff --git a/src/w32dwrite.c b/src/w32dwrite.c
index 32e2644af2c..29f9d5f1fed 100644
--- a/src/w32dwrite.c
+++ b/src/w32dwrite.c
@@ -37,7 +37,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <math.h>
#include <windows.h>
-#ifndef MINGW_W64
+#if !defined MINGW_W64 && !defined CYGWIN
# define INITGUID
#endif
#include <initguid.h>
@@ -659,7 +659,7 @@ w32_dwrite_encode_char (struct font *font, int c)
if (dwrite_font_face == NULL)
return FONT_INVALID_CODE;
hr = dwrite_font_face->lpVtbl->GetGlyphIndices (dwrite_font_face,
- &c, 1, &index);
+ (UINT32 *) &c, 1, &index);
if (verify_hr (hr, "Failed to GetGlyphIndices"))
{
if (index == 0)
diff --git a/src/w32menu.c b/src/w32menu.c
index c3d147841b6..b5f87ebb42c 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -186,6 +186,11 @@ task_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam,
Lisp_Object
w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
{
+#ifdef NTGUI_UNICODE
+ typedef int (WINAPI *WideCharToMultiByte_Proc)(UINT,DWORD,LPCWSTR,int,LPSTR,
+ int,LPCSTR,LPBOOL);
+ static MultiByteToWideChar_Proc pMultiByteToWideChar = MultiByteToWideChar;
+#endif /* NTGUI_UNICODE */
check_window_system (f);
if (task_dialog_indirect)