From f2f4d4ddabdc946a0eca6da8f139c2e9e30d790a Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 8 Jan 2023 12:47:09 +0100 Subject: [PATCH] Update tar.h to use MSVC-compatible struct packing Fixes #3. --- LICENSE | 2 +- src/tar.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index ea56272..cd5cfb6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2022, apio +Copyright (c) 2022-2023, apio Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/tar.h b/src/tar.h index f6b6042..4547fcc 100644 --- a/src/tar.h +++ b/src/tar.h @@ -3,6 +3,8 @@ // Format of a raw standard tar header. +#pragma pack(push, 1) + struct tar_header { char name[100]; @@ -23,6 +25,8 @@ struct tar_header char prefix[155]; char padding[12]; // Not part of the header, only used to make the structure 512 bytes -} __attribute__((packed)); +}; + +#pragma pack(pop) #endif