+DEFUN ("mswindows-debugging-output", Fmswindows_debugging_output, 1, 1, 0, /*
+Write CHAR-OR-STRING to the Windows debugger, using OutputDebugString().
+This function can be used as the STREAM argument of Fprint() or the like.
+*/
+ (char_or_string))
+{
+ Extbyte *extstr;
+
+ if (STRINGP (char_or_string))
+ {
+ TO_EXTERNAL_FORMAT (LISP_STRING, char_or_string,
+ C_STRING_ALLOCA, extstr,
+ Qmswindows_tstr);
+ OutputDebugString (extstr);
+ }
+ else
+ {
+ Bufbyte str[MAX_EMCHAR_LEN + 1];
+ Bytecount len;
+
+ CHECK_CHAR_COERCE_INT (char_or_string);
+ len = set_charptr_emchar (str, XCHAR (char_or_string));
+ str[len] = '\0';
+ TO_EXTERNAL_FORMAT (C_STRING, str,
+ C_STRING_ALLOCA, extstr,
+ Qmswindows_tstr);
+ OutputDebugString (extstr);
+ }
+
+ return char_or_string;
+}