diff options
| author | Eli Zaretskii | 2024-11-12 14:41:01 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-11-12 14:41:01 +0200 |
| commit | b54fa15ffbb959e97ea0b77bfeb9ae412a63b4e8 (patch) | |
| tree | 9b22b5eaa78159a774030478e72370bbcdce2fac | |
| parent | 6ddbe8c7010485f6bca80b6e898610d5831eac60 (diff) | |
| download | emacs-b54fa15ffbb959e97ea0b77bfeb9ae412a63b4e8.tar.gz emacs-b54fa15ffbb959e97ea0b77bfeb9ae412a63b4e8.zip | |
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)
| -rw-r--r-- | src/pdumper.c | 11 | ||||
| -rw-r--r-- | src/w32dwrite.c | 4 | ||||
| -rw-r--r-- | src/w32menu.c | 5 |
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 | |||
| 4853 | static void | 4853 | static void |
| 4854 | dump_mm_heap_cb_release (struct dump_memory_map_heap_control_block *cb) | 4854 | dump_mm_heap_cb_release (struct dump_memory_map_heap_control_block *cb) |
| 4855 | { | 4855 | { |
| 4856 | eassert (cb->refcount > 0); | 4856 | if (cb) |
| 4857 | if (--cb->refcount == 0) | ||
| 4858 | { | 4857 | { |
| 4859 | free (cb->mem); | 4858 | eassert (cb->refcount > 0); |
| 4860 | free (cb); | 4859 | if (--cb->refcount == 0) |
| 4860 | { | ||
| 4861 | free (cb->mem); | ||
| 4862 | free (cb); | ||
| 4863 | } | ||
| 4861 | } | 4864 | } |
| 4862 | } | 4865 | } |
| 4863 | 4866 | ||
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/>. */ | |||
| 37 | #include <math.h> | 37 | #include <math.h> |
| 38 | #include <windows.h> | 38 | #include <windows.h> |
| 39 | 39 | ||
| 40 | #ifndef MINGW_W64 | 40 | #if !defined MINGW_W64 && !defined CYGWIN |
| 41 | # define INITGUID | 41 | # define INITGUID |
| 42 | #endif | 42 | #endif |
| 43 | #include <initguid.h> | 43 | #include <initguid.h> |
| @@ -659,7 +659,7 @@ w32_dwrite_encode_char (struct font *font, int c) | |||
| 659 | if (dwrite_font_face == NULL) | 659 | if (dwrite_font_face == NULL) |
| 660 | return FONT_INVALID_CODE; | 660 | return FONT_INVALID_CODE; |
| 661 | hr = dwrite_font_face->lpVtbl->GetGlyphIndices (dwrite_font_face, | 661 | hr = dwrite_font_face->lpVtbl->GetGlyphIndices (dwrite_font_face, |
| 662 | &c, 1, &index); | 662 | (UINT32 *) &c, 1, &index); |
| 663 | if (verify_hr (hr, "Failed to GetGlyphIndices")) | 663 | if (verify_hr (hr, "Failed to GetGlyphIndices")) |
| 664 | { | 664 | { |
| 665 | if (index == 0) | 665 | 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, | |||
| 186 | Lisp_Object | 186 | Lisp_Object |
| 187 | w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) | 187 | w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) |
| 188 | { | 188 | { |
| 189 | #ifdef NTGUI_UNICODE | ||
| 190 | typedef int (WINAPI *WideCharToMultiByte_Proc)(UINT,DWORD,LPCWSTR,int,LPSTR, | ||
| 191 | int,LPCSTR,LPBOOL); | ||
| 192 | static MultiByteToWideChar_Proc pMultiByteToWideChar = MultiByteToWideChar; | ||
| 193 | #endif /* NTGUI_UNICODE */ | ||
| 189 | check_window_system (f); | 194 | check_window_system (f); |
| 190 | 195 | ||
| 191 | if (task_dialog_indirect) | 196 | if (task_dialog_indirect) |