Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 23898) +++ trunk/src/plug_io.c (revision 23899) @@ -763,27 +763,6 @@ free(filename); } -#if !defined(HAS_ATEXIT) -/* makes a temporary copy of the data. This is useful for systems which - * doesn't support calling functions on exit. We use this to save the data - * before LEX and YACC functions are called because they are able to abort - * the program.*/ -void pcb_tmp_data_save(void) -{ - char *fn = pcb_build_fn(conf_core.rc.emergency_name); - pcb_write_pcb_file(fn, pcb_true, NULL, pcb_true, pcb_false); - if (TMPFilename != NULL) - free(TMPFilename); - TMPFilename = fn; -} - -void pcb_tmp_data_remove(void) -{ - if (TMPFilename != NULL) - unlink(TMPFilename); -} -#endif - /* Write the pcb file, a footprint or a buffer */ static int pcb_write_file(FILE *fp, pcb_bool thePcb, const char *old_path, const char *new_path, const char *fmt, pcb_bool emergency, pcb_bool elem_only) { Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 23898) +++ trunk/src/plug_io.h (revision 23899) @@ -130,11 +130,6 @@ int pcb_write_pipe(const char *, pcb_bool, const char *fmt, pcb_bool elem_only); void pcb_set_design_dir(const char *fn); -#ifndef HAS_ATEXIT -void pcb_tmp_data_save(void); -void pcb_tmp_data_remove(void); -#endif - /********** helpers **********/ /* wish we had more than 32 IO plugins... */ Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 23898) +++ trunk/src_plugins/io_pcb/file.c (revision 23899) @@ -1159,3 +1159,25 @@ pcb_layer_colors_from_conf(pcb, 1); pcb_rat_all_anchor_guess(pcb->Data); } + +#if !defined(HAS_ATEXIT) +/* makes a temporary copy of the data. This is useful for systems which + * doesn't support calling functions on exit. We use this to save the data + * before LEX and YACC functions are called because they are able to abort + * the program.*/ +void pcb_tmp_data_save(void) +{ + char *fn = pcb_build_fn(conf_core.rc.emergency_name); + pcb_write_pcb_file(fn, pcb_true, NULL, pcb_true, pcb_false); + if (TMPFilename != NULL) + free(TMPFilename); + TMPFilename = fn; +} + +void pcb_tmp_data_remove(void) +{ + if (TMPFilename != NULL) + unlink(TMPFilename); +} +#endif + Index: trunk/src_plugins/io_pcb/file.h =================================================================== --- trunk/src_plugins/io_pcb/file.h (revision 23898) +++ trunk/src_plugins/io_pcb/file.h (revision 23899) @@ -89,6 +89,11 @@ void io_pcb_preproc_board(pcb_board_t *pcb); void io_pcb_postproc_board(pcb_board_t *pcb); +#ifndef HAS_ATEXIT +void pcb_tmp_data_save(void); +void pcb_tmp_data_remove(void); +#endif + /* This is the version we support. */ #define PCB_FILE_VERSION 20110603