From 1e0b83ca10a8e334a85db96f15cef2d7058ec33d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 16 Sep 2014 11:05:31 -0700 Subject: [PATCH] SCP: Avoid building sim_video code when it isn't used by a simulator. This results in smaller simulator binaries. --- scp.c | 2 ++ sim_video.c | 4 ++++ sim_video.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/scp.c b/scp.c index 95e4cbac..b633ac0a 100644 --- a/scp.c +++ b/scp.c @@ -221,7 +221,9 @@ #include "sim_tape.h" #include "sim_ether.h" #include "sim_serial.h" +#if defined (USE_SIM_VIDEO) #include "sim_video.h" +#endif #include "sim_sock.h" #include #include diff --git a/sim_video.c b/sim_video.c index b5210b82..3cbc551c 100644 --- a/sim_video.c +++ b/sim_video.c @@ -27,6 +27,8 @@ 11-Jun-2013 MB First version */ +#if defined(USE_SIM_VIDEO) + #include "sim_video.h" t_bool vid_active = FALSE; @@ -1685,3 +1687,5 @@ return SCPE_OK; #endif + +#endif /* USE_SIM_VIDEO */ diff --git a/sim_video.h b/sim_video.h index bda09476..d4ad465a 100644 --- a/sim_video.h +++ b/sim_video.h @@ -30,6 +30,10 @@ #ifndef _SIM_VIDEO_H_ #define _SIM_VIDEO_H_ 0 +#if !defined(USE_SIM_VIDEO) +#error This simulator MUST be compiled with USE_SIM_VIDEO defined +#else + #include "sim_defs.h" #define SIM_KEYPRESS_DOWN 0 /* key states */ @@ -191,4 +195,6 @@ extern t_bool vid_mouse_b3; /* mouse button 3 state #define SIM_VID_DBG_KEY 0x02000000 #define SIM_VID_DBG_VIDEO 0x04000000 +#endif /* USE_SIM_VIDEO */ + #endif