diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2016-12-06 23:10:58 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2016-12-06 23:10:58 +0100 |
commit | 5e79d651caee6b7a81097ae432b829e3da952261 (patch) | |
tree | ffaeb6d2a7b1618fb6fd78ab8541cc5284ba5373 | |
parent | 676da477510cb1966a74273f89c8aa64654a1d49 (diff) | |
download | 0xFFFF-5e79d651caee6b7a81097ae432b829e3da952261.tar.bz2 |
all: Compile globally without _GNU_SOURCE, define _BSD_SOURCE or _GNU_SOURCE where needed
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/cal.c | 6 | ||||
-rw-r--r-- | src/disk.c | 6 | ||||
-rw-r--r-- | src/libusb-sniff.c | 4 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile index 6b8ef08..94a8790 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,7 +9,7 @@ CC = gcc CROSS_CC = $(CROSS_COMPILE)$(CC) HOST_CC = $(HOST_COMPILE)$(CC) -CPPFLAGS += -DVERSION=\"$(VERSION)\" -DBUILD_DATE="\"$(BUILD_DATE)\"" -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L +CPPFLAGS += -DVERSION=\"$(VERSION)\" -DBUILD_DATE="\"$(BUILD_DATE)\"" -D_POSIX_C_SOURCE=200809L CFLAGS += -W -Wall -O2 -pedantic -std=c99 LIBS += -lusb @@ -20,6 +20,12 @@ /* This is simple CAL parser form Calvaria */ +#ifdef __linux__ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif + #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -16,6 +16,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef __linux__ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif + #include <fcntl.h> #include <libgen.h> #include <unistd.h> diff --git a/src/libusb-sniff.c b/src/libusb-sniff.c index ea7ef48..91f7872 100644 --- a/src/libusb-sniff.c +++ b/src/libusb-sniff.c @@ -21,7 +21,11 @@ /* usage: sudo USBSNIFF_WAIT=1 LD_PRELOAD=./libusb-sniff.so flasher-3.5 ... */ /* usage: sudo USBSNIFF_SKIP_READ=1 USBSNIFF_SKIP_WRITE=1 LD_PRELOAD=./libusb-sniff.so flasher-3.5 ... */ +/* Enable RTLD_NEXT for glibc */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif + #include <stdio.h> #include <stdlib.h> #include <stdint.h> |