Skip to content

Commit

Permalink
tarlz: update build patch
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Oct 24, 2023
1 parent 8858b5e commit 0fe617f
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions tarlz/0.24.patch
Original file line number Diff line number Diff line change
@@ -1,50 +1,39 @@
diff --git a/create.cc b/create.cc
index 11c4041..fcfcc41 100644
index 11c4041..06d628c 100644
--- a/create.cc
+++ b/create.cc
@@ -27,6 +27,11 @@
@@ -26,6 +26,8 @@
#if !defined __FreeBSD__ && !defined __OpenBSD__ && !defined __NetBSD__ && \
!defined __DragonFly__ && !defined __APPLE__ && !defined __OS2__
#include <sys/sysmacros.h> // for major, minor
+#else
+#include <sys/types.h> // for major, minor
#endif
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define major(x) ((int)(0x00ff & ((x) >> 8)))
+#define minor(x) ((int)(0xffff00ff & (x)))
+#endif
#include <ftw.h>
#include <grp.h>
#include <pwd.h>
diff --git a/decode.cc b/decode.cc
index 1742df2..31abc3f 100644
index 1742df2..6743491 100644
--- a/decode.cc
+++ b/decode.cc
@@ -30,6 +30,12 @@
@@ -29,6 +29,8 @@
#if !defined __FreeBSD__ && !defined __OpenBSD__ && !defined __NetBSD__ && \
!defined __DragonFly__ && !defined __APPLE__ && !defined __OS2__
#include <sys/sysmacros.h> // for major, minor, makedev
+#else
+#include <sys/types.h> // for major, minor, makedev
#endif
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define major(x) ((int)(0x00ff & ((x) >> 8)))
+#define minor(x) ((int)(0xffff00ff & (x)))
+#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
#include <lzlib.h>

#include "tarlz.h"
diff --git a/decode_lz.cc b/decode_lz.cc
index 15ac2a7..4bfc627 100644
index 15ac2a7..a31384b 100644
--- a/decode_lz.cc
+++ b/decode_lz.cc
@@ -30,6 +30,12 @@
@@ -29,6 +29,8 @@
#if !defined __FreeBSD__ && !defined __OpenBSD__ && !defined __NetBSD__ && \
!defined __DragonFly__ && !defined __APPLE__ && !defined __OS2__
#include <sys/sysmacros.h> // for major, minor, makedev
+#else
+#include <sys/types.h> // for major, minor, makedev
#endif
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define major(x) ((int)(0x00ff & ((x) >> 8)))
+#define minor(x) ((int)(0xffff00ff & (x)))
+#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
#include <lzlib.h>

#include "tarlz.h"

0 comments on commit 0fe617f

Please sign in to comment.