Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 16264) +++ trunk/config.h.in (revision 16265) @@ -189,7 +189,7 @@ /* Format: abccrrrrr where a, b and c are pcb-rnd version numbers and r is the svn revision number (optional) */ -#define PCB_API_VER "@/local/apiver@" +#define PCB_API_VER @/local/apiver@ /* Define to 1 if you have the `dmalloc' library (-ldmalloc); Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 16264) +++ trunk/scconfig/Rev.h (revision 16265) @@ -1 +1 @@ -static const int myrev = 16263; +static const int myrev = 16265; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 16264) +++ trunk/scconfig/Rev.tab (revision 16265) @@ -1,4 +1,4 @@ -16263 configure introducing pcb api ver +16265 configure introducing pcb api ver 16233 configure retire hid_srv_ws: we are not going to use websockets for the web variant 16155 configure rewrite route style anchored menu to be central 16109 configure split off grid code from crosshair code and move gui-specific part out from core Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 16264) +++ trunk/src/hid.h (revision 16265) @@ -12,11 +12,6 @@ #include "layer.h" #include "layer_grp.h" -/* core's version stored in hid_actions.o */ -extern unsigned long pcb_api_ver; - -#define PCB_API_VER_MATCH (PCB_API_VER == pcb_hid_ver) - /* attribute dialog properties */ typedef enum pcb_hat_property_e { PCB_HATP_GLOBAL_CALLBACK, Index: trunk/src/hid_actions.c =================================================================== --- trunk/src/hid_actions.c (revision 16264) +++ trunk/src/hid_actions.c (revision 16265) @@ -12,8 +12,6 @@ #include "compat_misc.h" #include "compat_nls.h" -unsigned long pcb_api_ver = PCB_API_VER; - static htsp_t *all_actions = NULL; const pcb_hid_action_t *pcb_current_action = NULL; Index: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c (revision 16264) +++ trunk/src/plugins.c (revision 16265) @@ -34,6 +34,8 @@ #include "compat_misc.h" #include "hid.h" +unsigned long pcb_api_ver = PCB_API_VER; + pup_context_t pcb_pup; char **pcb_pup_paths = NULL; static int paths_used = 0, paths_alloced = 0; Index: trunk/src/plugins.h =================================================================== --- trunk/src/plugins.h (revision 16264) +++ trunk/src/plugins.h (revision 16265) @@ -30,6 +30,19 @@ #include #include +/* core's version stored in plugins.o */ +extern unsigned long pcb_api_ver; + +#define PCB_API_VER_MATCH (PCB_API_VER == pcb_api_ver) +#define PCB_API_CHK_VER \ +do { \ + if (!PCB_API_VER_MATCH) {\ + fprintf(stderr, "pcb-rnd API version incompatibility: " __FILE__ "=%d core=%d\n(not loading this plugin)\n", PCB_API_VER, pcb_api_ver); \ + return 1; \ + } \ + return 0; \ +} while(0) + extern pup_context_t pcb_pup; extern char **pcb_pup_paths;