1
0
mirror of https://github.com/facebook/zstd.git synced 2025-11-27 11:41:11 +03:00

Add ifndef guards for _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE

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.
This commit is contained in:
Gregory Szorc
2020-12-26 10:00:53 -07:00
parent d4f7d75f84
commit dd1a7e41ee

View File

@@ -23,10 +23,14 @@
/* 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
/*-*************************************