Remove WinCE code from gdbreplay
authorPedro Alves <pedro@palves.net>
Mon, 12 Apr 2021 19:23:54 +0000 (20:23 +0100)
committerPedro Alves <pedro@palves.net>
Tue, 13 Apr 2021 21:18:24 +0000 (22:18 +0100)
gdbserver/ChangeLog:

* gdbreplay.c [__MINGW32CE__] (COUNTOF, errno, strerror): Remove.

gdbserver/ChangeLog
gdbserver/gdbreplay.cc

index ff008151421a5a6c3c4b23d6c961da9640e13e56..4a9c906bed7385db1aa38adb7908ecfecf7cfd3e 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-13  Pedro Alves  <pedro@palves.net>
+
+       * gdbreplay.c [__MINGW32CE__] (COUNTOF, errno, strerror): Remove.
+
 2021-04-13  Tom Tromey  <tromey@adacore.com>
 
        * win32-low.cc (winapi_CreateToolhelp32Snapshot)
index 864a31e58f73b8a6064a1473c5377ee6c3833744..3705e9bf45fcafd51fe04268e2b90029922fca65 100644 (file)
@@ -69,57 +69,6 @@ typedef int socklen_t;
 static int remote_desc_in;
 static int remote_desc_out;
 
-#ifdef __MINGW32CE__
-
-#ifndef COUNTOF
-#define COUNTOF(STR) (sizeof (STR) / sizeof ((STR)[0]))
-#endif
-
-#define errno (GetLastError ())
-
-char *
-strerror (DWORD error)
-{
-  static char buf[1024];
-  WCHAR *msgbuf;
-  DWORD lasterr = GetLastError ();
-  DWORD chars = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM
-                               | FORMAT_MESSAGE_ALLOCATE_BUFFER,
-                               NULL,
-                               error,
-                               0, /* Default language */
-                               (LPVOID)&msgbuf,
-                               0,
-                               NULL);
-  if (chars != 0)
-    {
-      /* If there is an \r\n appended, zap it.  */
-      if (chars >= 2
-         && msgbuf[chars - 2] == '\r'
-         && msgbuf[chars - 1] == '\n')
-       {
-         chars -= 2;
-         msgbuf[chars] = 0;
-       }
-
-      if (chars > ((COUNTOF (buf)) - 1))
-       {
-         chars = COUNTOF (buf) - 1;
-         msgbuf [chars] = 0;
-       }
-
-      wcstombs (buf, msgbuf, chars + 1);
-      LocalFree (msgbuf);
-    }
-  else
-    sprintf (buf, "unknown win32 error (%ld)", error);
-
-  SetLastError (lasterr);
-  return buf;
-}
-
-#endif /* __MINGW32CE__ */
-
 static void
 sync_error (FILE *fp, const char *desc, int expect, int got)
 {
This page took 0.032723 seconds and 4 git commands to generate.