#include <inttypes.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _sd_packed_
+# define _sd_packed_ __attribute__((packed))
+#endif
+
typedef enum sd_shutdown_mode {
SD_SHUTDOWN_NONE = 0,
SD_SHUTDOWN_REBOOT = 'r',
/* Calculate the size of the message as "offsetof(struct
* sd_shutdown_command, wall_message) +
* strlen(command.wall_message)" */
-__attribute__((packed)) struct sd_shutdown_command {
+struct sd_shutdown_command {
/* Microseconds after the epoch 1970 UTC */
uint64_t usec;
/* The wall message to send around. Leave empty for the
* default wall message */
char wall_message[];
-};
+} _sd_packed_;
/* The scheme is very simple:
*
* anybody.
*/
+#ifdef __cplusplus
+}
+#endif
+
#endif