Re: target_core_user.h in C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/13/2015 11:28 AM, Oleg Smolsky wrote:
-enum tcmu_opcode {
+enum tcmu_opcode
+#if defined(__cplusplus)
+        : __u32
+#endif
+{

Will this work with older C++ compilers ?

  static inline enum tcmu_opcode tcmu_hdr_get_op(__u32 len_op)
  {
-       return len_op & TCMU_OP_MASK;
+        __u32 rv = len_op & TCMU_OP_MASK;
+#if defined(__cplusplus)
+        return tcmu_opcode(rv);
+#else
+        return rv;
+#endif
  }

How about using (enum tcmu_opcode)rv for C and C++ instead of the #ifdef construct ?

Bart.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux