Browse Source

Fix FTBFS with gpsim >= 0.27

Slávek Banko 5 years ago
parent
commit
109b2aa3a9
4 changed files with 42 additions and 1 deletions
  1. 3
    0
      config.h.in
  2. 16
    0
      configure.in
  3. 16
    0
      configure.in.in
  4. 7
    1
      src/electronics/gpsimprocessor.cpp

+ 3
- 0
config.h.in View File

@@ -9,6 +9,9 @@
9 9
 /* Gpsim 0.21.4 was found */
10 10
 #undef GPSIM_0_21_4
11 11
 
12
+/* Gpsim 0.27.0 was found */
13
+#undef GPSIM_0_27_0
14
+
12 15
 /* Define to 1 if you have the <Carbon/Carbon.h> header file. */
13 16
 #undef HAVE_CARBON_CARBON_H
14 17
 

+ 16
- 0
configure.in View File

@@ -131,6 +131,18 @@ AC_TRY_COMPILE(
131 131
 	AC_MSG_RESULT( no )
132 132
 )
133 133
 
134
+AC_MSG_CHECKING([for gpsim 0.27.0 availability])
135
+AC_TRY_COMPILE(
136
+	[
137
+#include <gpsim/pic-processor.h>
138
+void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
139
+	],
140
+	[],
141
+	AC_MSG_RESULT( yes )
142
+	have_gpsim_0_27_0=yes,
143
+	AC_MSG_RESULT( no )
144
+)
145
+
134 146
 CXXFLAGS="$ktechlab_save_CXXFLAGS"
135 147
 AC_LANG_RESTORE
136 148
 
@@ -199,6 +211,10 @@ if test x$have_gpsim_0_21_4 == xyes || test x$have_gpsim_0_21_11 == xyes || test
199 211
 	LIBS="$ac_save_LIBS"
200 212
 fi
201 213
 
214
+if test x$have_gpsim_0_27_0 == xyes; then
215
+	AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
216
+fi
217
+
202 218
 AC_SUBST(LIB_GPSIM)
203 219
 
204 220
 ##############################

+ 16
- 0
configure.in.in View File

@@ -68,6 +68,18 @@ AC_TRY_COMPILE(
68 68
 	AC_MSG_RESULT( no )
69 69
 )
70 70
 
71
+AC_MSG_CHECKING([for gpsim 0.27.0 availability])
72
+AC_TRY_COMPILE(
73
+	[
74
+#include <gpsim/pic-processor.h>
75
+void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
76
+	],
77
+	[],
78
+	AC_MSG_RESULT( yes )
79
+	have_gpsim_0_27_0=yes,
80
+	AC_MSG_RESULT( no )
81
+)
82
+
71 83
 CXXFLAGS="$ktechlab_save_CXXFLAGS"
72 84
 AC_LANG_RESTORE
73 85
 
@@ -136,6 +148,10 @@ if test x$have_gpsim_0_21_4 == xyes || test x$have_gpsim_0_21_11 == xyes || test
136 148
 	LIBS="$ac_save_LIBS"
137 149
 fi
138 150
 
151
+if test x$have_gpsim_0_27_0 == xyes; then
152
+	AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
153
+fi
154
+
139 155
 AC_SUBST(LIB_GPSIM)
140 156
 
141 157
 ##############################

+ 7
- 1
src/electronics/gpsimprocessor.cpp View File

@@ -736,7 +736,13 @@ RegisterSet::RegisterSet( pic_processor * picProcessor )
736 736
 		m_nameToRegisterMap[ info->name() ] = info;
737 737
 	}
738 738
 	
739
-	RegisterInfo * info = new RegisterInfo( picProcessor->W );
739
+	RegisterInfo * info = new RegisterInfo(
740
+#ifdef GPSIM_0_27_0
741
+		picProcessor->Wreg
742
+#else
743
+		picProcessor->W
744
+#endif
745
+		);
740 746
 	m_registers.append( info );
741 747
 	m_nameToRegisterMap[ info->name() ] = info;
742 748
 }

Loading…
Cancel
Save