OSDN Git Service

libbinder: Don't redefine B_PACK_CHARS
authorChristopher Wiley <wiley@google.com>
Fri, 4 Dec 2015 22:15:27 +0000 (14:15 -0800)
committerChristopher Wiley <wiley@google.com>
Sat, 5 Dec 2015 00:05:03 +0000 (16:05 -0800)
This macro is defined in linux/binder.h which is *sometimes* included
before binder/IBinder.h depending on codepath.

Bug: 25868260
Test: Compiles

Change-Id: Ied1e6658936668c16cbdacab3a3205107c907655

include/binder/IBinder.h

index 43b6543..607c18b 100644 (file)
 #ifndef ANDROID_IBINDER_H
 #define ANDROID_IBINDER_H
 
+#include <cstdlib>  // Defines types needed for linux/binder.h
+#include <linux/binder.h>  // Needed for B_PACK_CHARS
+
 #include <utils/Errors.h>
 #include <utils/RefBase.h>
 #include <utils/String16.h>
 #include <utils/Vector.h>
 
-
-#define B_PACK_CHARS(c1, c2, c3, c4) \
-    ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
+#ifndef B_PACK_CHARS
+#error "linux/binder.h no longer defines B_PACK_CHARS"
+#endif
 
 // ---------------------------------------------------------------------------
 namespace android {