Fix build issues with MinGW
[fw/stlink] / gdbserver / gdb-server.c
index bf1478122a25db0832ef37805122345aad08da2f..a6de1b20d2db8f68fc6f2891e2b5e1f338ce809e 100644 (file)
@@ -57,6 +57,7 @@ typedef struct _st_state_t {
 int serve(stlink_t *sl, st_state_t *st);
 char* make_memory_map(stlink_t *sl);
 
+#ifndef __MINGW32__
 static void cleanup(int signal __attribute__((unused))) {
     if (connected_stlink) {
         /* Switch back to mass storage mode before closing. */
@@ -67,6 +68,7 @@ static void cleanup(int signal __attribute__((unused))) {
 
     exit(1);
 }
+#endif
 
 
 
@@ -196,8 +198,10 @@ int main(int argc, char** argv) {
     }
 
     connected_stlink = sl;
+#ifndef __MINGW32__
     signal(SIGINT, &cleanup);
     signal(SIGTERM, &cleanup);
+#endif
 
     if (state.reset) {
                stlink_reset(sl);