Merge pull request #185 from ouah/master
[fw/stlink] / gdbserver / gdb-server.c
index a6de1b20d2db8f68fc6f2891e2b5e1f338ce809e..7e8bb685a7ab7e7e12a931ce7fd7fd6cd86e834d 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include <getopt.h>
+#include <signal.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -18,7 +19,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <signal.h>
 #endif
 
 #include <stlink-common.h>
@@ -57,7 +57,6 @@ 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. */
@@ -68,7 +67,6 @@ static void cleanup(int signal __attribute__((unused))) {
 
     exit(1);
 }
-#endif
 
 
 
@@ -174,7 +172,7 @@ int parse_options(int argc, char** argv, st_state_t *st) {
 
 
 int main(int argc, char** argv) {
-       uint32_t voltage;
+       int32_t voltage;
 
        stlink_t *sl = NULL;
 
@@ -198,10 +196,8 @@ int main(int argc, char** argv) {
     }
 
     connected_stlink = sl;
-#ifndef __MINGW32__
     signal(SIGINT, &cleanup);
     signal(SIGTERM, &cleanup);
-#endif
 
     if (state.reset) {
                stlink_reset(sl);