[Slirp] [Git][slirp/libslirp][master] Fix win32 builds by using the SLIRP_PACKED definition

Samuel Thibault gitlab at gitlab.freedesktop.org
Mon Jun 1 11:16:30 UTC 2020



Samuel Thibault pushed to branch master at slirp / libslirp


Commits:
bcaaa53a by Philippe Mathieu-Daudé at 2020-06-01T13:16:02+02:00
Fix win32 builds by using the SLIRP_PACKED definition

A packed struct needs different gcc attributes for compilations
with MinGW compilers because glib-2.0 adds compiler flag
-mms-bitfields which modifies the packing algorithm.

Attribute gcc_struct reverses the negative effects of -mms-bitfields.

We already have the SLIRP_PACKED definition for that, use it.

Signed-off-by: Philippe Mathieu-Daudé <philmd at redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

- - - - -


1 changed file:

- src/tftp.h


Changes:

=====================================
src/tftp.h
=====================================
@@ -4,6 +4,8 @@
 #ifndef SLIRP_TFTP_H
 #define SLIRP_TFTP_H
 
+#include "util.h"
+
 #define TFTP_SESSIONS_MAX 20
 
 #define TFTP_SERVER 69
@@ -32,7 +34,7 @@ struct tftp_t {
         } tp_error;
         char tp_buf[TFTP_BLOCKSIZE_MAX + 2];
     } x;
-} __attribute__((packed));
+} SLIRP_PACKED;
 
 struct tftp_session {
     Slirp *slirp;



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/bcaaa53a7527734917753887238967a698647ac2

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/bcaaa53a7527734917753887238967a698647ac2
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20200601/99fea117/attachment.htm>


More information about the Slirp mailing list