[threadpool] Remove assertion on RequestWorkerThread failure (#4167)
[mono.git] / mono / sgen / sgen-protocol.h
index 1c10d29d5c0e367f07e8d26a0163177da59c1b41..3fe848878ec8e212ef60bf6ab411e5b3f3306706 100644 (file)
 #define BINARY_PROTOCOL_NO_MATCH (-1)
 #define BINARY_PROTOCOL_MATCH (-2)
 
-/* We pack all protocol structs by default unless specified otherwise */
-#ifndef PROTOCOL_STRUCT_ATTR
-#ifdef __GNUC__
-#define PROTOCOL_STRUCT_ATTR __attribute__ ((packed))
-#else
-#define PROTOCOL_STRUCT_ATTR
-#endif
-#endif
-
 #define PROTOCOL_ID(method) method ## _id
 #define PROTOCOL_STRUCT(method) method ## _struct
 #define CLIENT_PROTOCOL_NAME(method) sgen_client_ ## method
@@ -80,6 +71,19 @@ enum {
 #include "sgen-protocol-def.h"
 };
 
+/* We pack all protocol structs by default unless specified otherwise */
+#ifndef PROTOCOL_STRUCT_ATTR
+
+#define PROTOCOL_PACK_STRUCTS
+
+#if defined(__GNUC__)
+#define PROTOCOL_STRUCT_ATTR __attribute__ ((packed))
+#else
+#define PROTOCOL_STRUCT_ATTR
+#endif
+
+#endif
+
 #define BEGIN_PROTOCOL_ENTRY0(method)
 #define BEGIN_PROTOCOL_ENTRY1(method,t1,f1) \
        typedef struct PROTOCOL_STRUCT_ATTR { \
@@ -147,14 +151,22 @@ enum {
 #define END_PROTOCOL_ENTRY_FLUSH
 #define END_PROTOCOL_ENTRY_HEAVY
 
+#if defined(_MSC_VER) && defined(PROTOCOL_PACK_STRUCTS)
+#pragma pack(push)
+#pragma pack(1)
+#endif
 #include "sgen-protocol-def.h"
+#if defined(_MSC_VER) && defined(PROTOCOL_PACK_STRUCTS)
+#pragma pack(pop)
+#undef PROTOCOL_PACK_STRUCTS
+#endif
 
 /* missing: finalizers, roots, non-store wbarriers */
 
 void binary_protocol_init (const char *filename, long long limit);
 gboolean binary_protocol_is_enabled (void);
 
-void binary_protocol_flush_buffers (gboolean force);
+gboolean binary_protocol_flush_buffers (gboolean force);
 
 #define BEGIN_PROTOCOL_ENTRY0(method) \
        void method (void);