Skip to content

Apply patch to fix serialization on ARM.#8

Merged
dirk-thomas merged 1 commit intoros:groovy-develfrom
ahendrix:groovy-devel
Mar 5, 2013
Merged

Apply patch to fix serialization on ARM.#8
dirk-thomas merged 1 commit intoros:groovy-develfrom
ahendrix:groovy-devel

Conversation

@ahendrix
Copy link
Copy Markdown

@ahendrix ahendrix commented Mar 5, 2013

Apply patch ask_arm_flag_serialization.h.diff from https://code.ros.org/trac/ros/ticket/2883

This fixes ros/ros_comm#184

dirk-thomas added a commit that referenced this pull request Mar 5, 2013
Apply patch to fix serialization on ARM.
@dirk-thomas dirk-thomas merged commit 814da65 into ros:groovy-devel Mar 5, 2013
@sem23
Copy link
Copy Markdown

sem23 commented Mar 5, 2013

--- ./include/ros/serialization.h   2013-03-05 10:07:18.210946502 +0100
+++ ./patch/serialization.h 2013-03-05 10:03:51.195321502 +0100
@@ -170,6 +170,7 @@
   return Serializer::serializedLength(t);
 }
 
+#if (!(defined __ARMEL__ && defined __VFP_FP__))
 #define ROS_CREATE_SIMPLE_SERIALIZER(Type) \
   template<> struct Serializer \
   { \
@@ -188,6 +189,26 @@
       return sizeof(Type); \
     } \
   };
+#else
+#define ROS_CREATE_SIMPLE_SERIALIZER(Type) \
+  template<> struct Serializer \
+  { \
+    template inline static void write(Stream& stream, const Type v) \
+    { \
+      memcpy((void*)stream.advance(sizeof(v)), (const void*) &v, sizeof(v)); \
+    } \
+    \
+    template inline static void read(Stream& stream, Type& v) \
+    { \
+      memcpy((void*)&v, (const void*) stream.advance(sizeof(v)), sizeof(v)); \
+    } \
+    \
+    inline static uint32_t serializedLength(const Type&) \
+    { \
+      return sizeof(Type); \
+    } \
+  };
+#endif
 
 ROS_CREATE_SIMPLE_SERIALIZER(uint8_t);
 ROS_CREATE_SIMPLE_SERIALIZER(int8_t);

@dirk-thomas
Copy link
Copy Markdown
Member

A patch was already committed to roscpp_core as references above. Please take a look to that patch and comment if you think it needs further tweaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants