Index: src/compat_misc.c =================================================================== --- src/compat_misc.c (revision 2516) +++ src/compat_misc.c (revision 2517) @@ -91,5 +91,9 @@ #else return "Unknown"; #endif +} +int pcb_getpid(void) +{ + return getpid(); } Index: src/compat_misc.h =================================================================== --- src/compat_misc.h (revision 2516) +++ src/compat_misc.h (revision 2517) @@ -38,5 +38,6 @@ long pcb_rand(void); const char *get_user_name(void); +int pcb_getpid(void); #endif /* PCB_COMPAT_MISC_H */ Index: src/draw_fab.c =================================================================== --- src/draw_fab.c (revision 2516) +++ src/draw_fab.c (revision 2517) @@ -36,9 +36,6 @@ #include "config.h" #include -#ifdef HAVE_UNISTD_H -#include -#endif #include Index: src/error.c =================================================================== --- src/error.c (revision 2516) +++ src/error.c (revision 2517) @@ -25,10 +25,7 @@ */ -/* error and debug functions - * getpid() needs a cast to (int) to get rid of compiler warnings - * on several architectures - */ +/* error and debug functions */ #include "config.h" @@ -152,7 +149,7 @@ /* try to save the layout and do some cleanup */ EmergencySave(); - fprintf(stderr, "pcb-rnd (%i): fatal, ", (int) getpid()); + fprintf(stderr, "pcb-rnd (%i): fatal, ", pcb_getpid()); vfprintf(stderr, Format, args); fflush(stderr); va_end(args); Index: src/hid_init.c =================================================================== --- src/hid_init.c (revision 2516) +++ src/hid_init.c (revision 2517) @@ -11,7 +11,6 @@ #include #include #include -#include #if defined(WIN32) && defined(HAVE_WINDOWS_H) #include Index: src/main.c =================================================================== --- src/main.c (revision 2516) +++ src/main.c (revision 2517) @@ -33,7 +33,6 @@ #include #include #include -#include #include #include /* Seed for srand() */ #include Index: src/misc.c =================================================================== --- src/misc.c (revision 2516) +++ src/misc.c (revision 2517) @@ -40,9 +40,6 @@ #include #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include "box.h" #include "crosshair.h" Index: src/plug_io.c =================================================================== --- src/plug_io.c (revision 2516) +++ src/plug_io.c (revision 2517) @@ -29,10 +29,7 @@ /* This used to be file.c; some of the code landed in the io_pcb plugin, the format-independent parts ended up here. */ -/* file save, load, merge ... routines - * getpid() needs a cast to (int) to get rid of compiler warnings - * on several architectures - */ +/* file save, load, merge ... routines */ #warning TODO: do not hardwire this, make a function to decide #define DEFAULT_FMT "pcb" @@ -57,12 +54,6 @@ #include #include - -#ifdef HAVE_UNISTD_H -#include -#endif - - #include "buffer.h" #include "change.h" #include "create.h" @@ -583,7 +574,7 @@ /* memory might have been released before this function is called */ if (PCB && PCB->Changed) { - sprintf(filename, conf_core.rc.emergency_name, (int) getpid()); + sprintf(filename, conf_core.rc.emergency_name, pcb_getpid()); Message(_("Trying to save your layout in '%s'\n"), filename); WritePCBFile(filename, DEFAULT_FMT); } @@ -665,7 +656,7 @@ curr = next+1; break; case 'P': - sprintf(buff, "%.8i", getpid()); + sprintf(buff, "%.8i", pcb_getpid()); gds_append_str(&s, buff); curr = next+1; break; Index: src/rubberband.c =================================================================== --- src/rubberband.c (revision 2516) +++ src/rubberband.c (revision 2517) @@ -33,9 +33,6 @@ #include #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include "create.h" #include "data.h" Index: src_plugins/export_gerber/gerber.c =================================================================== --- src_plugins/export_gerber/gerber.c (revision 2516) +++ src_plugins/export_gerber/gerber.c (revision 2517) @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include Index: src_plugins/hid_batch/batch.c =================================================================== --- src_plugins/hid_batch/batch.c (revision 2516) +++ src_plugins/hid_batch/batch.c (revision 2517) @@ -4,7 +4,6 @@ #include #include #include -#include #include "global.h" #include "hid.h" @@ -120,6 +119,7 @@ REGISTER_ACTIONS(batch_action_list, batch_cookie) +extern int isatty(); /* ----------------------------------------------------------------------------- */ static int batch_stay; Index: src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- src_plugins/hid_gtk/gtkhid-main.c (revision 2516) +++ src_plugins/hid_gtk/gtkhid-main.c (revision 2517) @@ -6,9 +6,7 @@ #include #include #include -#include - #include "action_helper.h" #include "crosshair.h" #include "error.h" Index: src_plugins/hid_gtk/gui-top-window.c =================================================================== --- src_plugins/hid_gtk/gui-top-window.c (revision 2516) +++ src_plugins/hid_gtk/gui-top-window.c (revision 2517) @@ -53,7 +53,6 @@ #include "config.h" #include "conf_core.h" -#include #include #include "ghid-layer-selector.h" #include "ghid-route-style-selector.h" Index: src_plugins/hid_lesstif/main.c =================================================================== --- src_plugins/hid_lesstif/main.c (revision 2516) +++ src_plugins/hid_lesstif/main.c (revision 2517) @@ -9,7 +9,6 @@ #include #include #include -#include #include #include Index: src_plugins/hid_lesstif/menu.c =================================================================== --- src_plugins/hid_lesstif/menu.c (revision 2516) +++ src_plugins/hid_lesstif/menu.c (revision 2517) @@ -5,7 +5,6 @@ #include #include #include -#include #include #include "xincludes.h" Index: src_plugins/io_pcb/file.c =================================================================== --- src_plugins/io_pcb/file.c (revision 2516) +++ src_plugins/io_pcb/file.c (revision 2517) @@ -25,10 +25,7 @@ * */ -/* file save, load, merge ... routines - * getpid() needs a cast to (int) to get rid of compiler warnings - * on several architectures - */ +/* file save, load, merge ... routines */ #include "config.h" #include "conf_core.h" @@ -50,11 +47,6 @@ #include #include -#ifdef HAVE_UNISTD_H -#include -#endif - - #include "buffer.h" #include "change.h" #include "create.h" Index: src_plugins/vendordrill/vendor.c =================================================================== --- src_plugins/vendordrill/vendor.c (revision 2516) +++ src_plugins/vendordrill/vendor.c (revision 2517) @@ -35,11 +35,7 @@ #ifdef HAVE_REGEX_H #include -#else -#ifdef HAVE_UNISTD_H -#include #endif -#endif #include "change.h" #include "data.h"