fix of bug #533274
[fw/sdcc] / sim / ucsim / gui.src / serio.src / main.cc
index 9589f5d6779d816813c21ea1d9b0d89fe67e0067..610d7dbc0bd0addb8a370f84b344ceb3bed36408 100644 (file)
@@ -2,6 +2,7 @@
  * to emulate the serial input and output of an 8051 controller               *
  * main.cc - the main stuff                                                   *
  ******************************************************************************/
+#include "ddconfig.h"
 #include <sys/types.h>
 #include <iostream.h>
 #include <stdlib.h>
@@ -11,6 +12,9 @@
 #include <string.h>
 #include <unistd.h>
 #include <signal.h>
+#ifdef HAVE_GETOPT_H // fix of bug #533274
+#include <getopt.h>
+#endif
 #include "fileio.hh"
 #include "frontend.hh"
 #include "posix_signal.hh"
@@ -44,7 +48,7 @@ int main(int argc, char **argv)
        char *string = new char[MAX_SIZ];
        extern char *optarg;
        int errflg=0;
-       char c;
+       int c;
        char *infile = DEF_INFILE;
        char *outfile = DEF_OUTFILE;