summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-12-27 04:07:32 +0100
committerSlávek Banko <slavek.banko@axis.cz>2013-12-27 04:12:46 +0100
commit109b2aa3a96405c0bf0ec48e2c59f4e97fc5b03e (patch)
tree505cf1f4dc74479756c931b2e119f484227b0be2
parentb6b1fae2432a640757cf34cac8d280be41bd177a (diff)
downloadktechlab-109b2aa3a96405c0bf0ec48e2c59f4e97fc5b03e.tar.gz
ktechlab-109b2aa3a96405c0bf0ec48e2c59f4e97fc5b03e.zip
Fix FTBFS with gpsim >= 0.27
-rw-r--r--config.h.in3
-rw-r--r--configure.in16
-rw-r--r--configure.in.in16
-rw-r--r--src/electronics/gpsimprocessor.cpp8
4 files changed, 42 insertions, 1 deletions
diff --git a/config.h.in b/config.h.in
index 6c12ac3..c8499c0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,6 +9,9 @@
/* Gpsim 0.21.4 was found */
#undef GPSIM_0_21_4
+/* Gpsim 0.27.0 was found */
+#undef GPSIM_0_27_0
+
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
diff --git a/configure.in b/configure.in
index 8e0d9ba..7792976 100644
--- a/configure.in
+++ b/configure.in
@@ -131,6 +131,18 @@ AC_TRY_COMPILE(
AC_MSG_RESULT( no )
)
+AC_MSG_CHECKING([for gpsim 0.27.0 availability])
+AC_TRY_COMPILE(
+ [
+#include <gpsim/pic-processor.h>
+void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
+ ],
+ [],
+ AC_MSG_RESULT( yes )
+ have_gpsim_0_27_0=yes,
+ AC_MSG_RESULT( no )
+)
+
CXXFLAGS="$ktechlab_save_CXXFLAGS"
AC_LANG_RESTORE
@@ -199,6 +211,10 @@ if test x$have_gpsim_0_21_4 == xyes || test x$have_gpsim_0_21_11 == xyes || test
LIBS="$ac_save_LIBS"
fi
+if test x$have_gpsim_0_27_0 == xyes; then
+ AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
+fi
+
AC_SUBST(LIB_GPSIM)
##############################
diff --git a/configure.in.in b/configure.in.in
index 434d2c6..e1fdd88 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -68,6 +68,18 @@ AC_TRY_COMPILE(
AC_MSG_RESULT( no )
)
+AC_MSG_CHECKING([for gpsim 0.27.0 availability])
+AC_TRY_COMPILE(
+ [
+#include <gpsim/pic-processor.h>
+void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
+ ],
+ [],
+ AC_MSG_RESULT( yes )
+ have_gpsim_0_27_0=yes,
+ AC_MSG_RESULT( no )
+)
+
CXXFLAGS="$ktechlab_save_CXXFLAGS"
AC_LANG_RESTORE
@@ -136,6 +148,10 @@ if test x$have_gpsim_0_21_4 == xyes || test x$have_gpsim_0_21_11 == xyes || test
LIBS="$ac_save_LIBS"
fi
+if test x$have_gpsim_0_27_0 == xyes; then
+ AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
+fi
+
AC_SUBST(LIB_GPSIM)
##############################
diff --git a/src/electronics/gpsimprocessor.cpp b/src/electronics/gpsimprocessor.cpp
index 587fc6f..c5ad638 100644
--- a/src/electronics/gpsimprocessor.cpp
+++ b/src/electronics/gpsimprocessor.cpp
@@ -736,7 +736,13 @@ RegisterSet::RegisterSet( pic_processor * picProcessor )
m_nameToRegisterMap[ info->name() ] = info;
}
- RegisterInfo * info = new RegisterInfo( picProcessor->W );
+ RegisterInfo * info = new RegisterInfo(
+#ifdef GPSIM_0_27_0
+ picProcessor->Wreg
+#else
+ picProcessor->W
+#endif
+ );
m_registers.append( info );
m_nameToRegisterMap[ info->name() ] = info;
}