/* Convert all slashes in a filename to backslashes, and map filename
to a valid 8.3 name if necessary. The result is a pointer to a
static buffer, so CAVEAT EMPTOR! */
-const char *map_w32_filename (const char *, const char **);
-
const char *
map_w32_filename (const char * name, const char ** pPath)
{
extern void syms_of_ntterm (void);
extern void dostounix_filename (register char *);
extern void unixtodos_filename (register char *);
+extern const char *map_w32_filename (const char *, const char **);
extern int filename_from_ansi (const char *, char *);
extern int filename_to_ansi (const char *, char *);
extern int filename_from_utf16 (const wchar_t *, char *);
extern int w32_console_toggle_lock_key (int, Lisp_Object);
extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
extern void w32_free_menu_strings (HWND);
-extern const char *map_w32_filename (const char *, const char **);
#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649)
#include <shlwapi.h>
#include "w32common.h"
#include "w32term.h"
+#ifdef WINDOWSNT
+#include "w32.h" /* for map_w32_filename, filename_to_utf16 */
+#endif
#include "frame.h"
#include "coding.h"
and succeeded. We have a valid token and GDI+ is active. */
if (STRINGP (spec_file))
{
- if (w32_unicode_filenames)
- {
- wchar_t filename[MAX_PATH];
- filename_to_utf16 (SSDATA (spec_file), filename);
- status = GdipCreateBitmapFromFile (filename, &pBitmap);
- }
- else
- {
- add_to_log ("GDI+ requires w32-unicode-filenames to be T");
- status = GenericError;
- }
+ spec_file = ENCODE_FILE (spec_file);
+ const char *fn = map_w32_filename (SSDATA (spec_file), NULL);
+ wchar_t filename_w[MAX_PATH];
+ filename_to_utf16 (fn, filename_w);
+ status = GdipCreateBitmapFromFile (filename_w, &pBitmap);
}
else if (STRINGP (spec_data))
{