]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add ifndef guards for _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE 2444/head
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 26 Dec 2020 17:00:53 +0000 (10:00 -0700)
committerGregory Szorc <gregory.szorc@gmail.com>
Sat, 26 Dec 2020 17:02:45 +0000 (10:02 -0700)
This ensures the symbols aren't redefined, which would result in a compiler
error.

I was getting redefined symbols for _LARGEFILE64_SOURCE when building for
32-bit x86 Linux on an older CentOS release in a CI environment. With this
change, I'm able to compile the single file library in this environment.

Closes #2443.

lib/dictBuilder/zdict.c

index 79c522ef3679ed344bd6041db21c9ac4ef81092a..baaa5715352150f6acf2d469c1d1933d63d9244f 100644 (file)
 /* Unix Large Files support (>4GB) */
 #define _FILE_OFFSET_BITS 64
 #if (defined(__sun__) && (!defined(__LP64__)))   /* Sun Solaris 32-bits requires specific definitions */
+#  ifndef _LARGEFILE_SOURCE
 #  define _LARGEFILE_SOURCE
+#  endif
 #elif ! defined(__LP64__)                        /* No point defining Large file for 64 bit */
+#  ifndef _LARGEFILE64_SOURCE
 #  define _LARGEFILE64_SOURCE
+#  endif
 #endif