Skip to content

Commit b8fca25

Browse files
authored
Merge pull request #132 from Hello71/no_override_cflags
use __linux/__unix instead of CMAKE_C(XX)_FLAGS
2 parents 19e6f3a + 3a84725 commit b8fca25

File tree

18 files changed

+32
-36
lines changed

18 files changed

+32
-36
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ else()
1717
endif()
1818

1919
if (UNIX)
20-
set(CMAKE_C_FLAGS "-DLINUX -DUNIX -DHAVE_STDBOOL_H")
2120
set(CMAKE_C_STANDARD 99)
22-
set(CMAKE_CXX_FLAGS "-DUNIX")
2321
set(CMAKE_CXX_STANDARD 11)
2422
set(THREADS_PREFER_PTHREAD_FLAG ON)
2523
find_package(Threads REQUIRED)

contrib/bzip2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OBJECTS = bzlib.o blocksort.o crctable.o compress.o decompress.o huffman.o randtable.o
2-
CFLAGS = -DLINUX -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wall
2+
CFLAGS = -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wall
33

44
.PHONY: all
55
all: $(OBJECTS)

contrib/bzip2/Makefile.32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OBJECTS = bzlib.o blocksort.o crctable.o compress.o decompress.o huffman.o randtable.o
2-
CFLAGS = -DLINUX -D_FILE_OFFSET_BITS=64 -O2 -Wall
2+
CFLAGS = -D_FILE_OFFSET_BITS=64 -O2 -Wall
33

44
.PHONY: all
55
all: $(OBJECTS)

contrib/giflib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OBJECTS = gifalloc.o gif_err.o dgif_lib_gcc.o egif_lib_gcc.o
2-
CFLAGS = -DLINUX -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wall
2+
CFLAGS = -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wall
33

44
.PHONY: all
55
all: $(OBJECTS)

contrib/giflib/Makefile.32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OBJECTS = gifalloc.o gif_err.o dgif_lib_gcc.o egif_lib_gcc.o
2-
CFLAGS = -DLINUX -D_FILE_OFFSET_BITS=64 -O2 -Wall
2+
CFLAGS = -D_FILE_OFFSET_BITS=64 -O2 -Wall
33

44
.PHONY: all
55
all: $(OBJECTS)

contrib/giflib/dgif_lib_gcc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifdef HAVE_FCNTL_H
3232
#include <fcntl.h>
3333
#endif /* HAVE_FCNTL_H */
34-
#ifndef LINUX
34+
#ifndef __linux
3535
#ifdef HAVE_UNISTD_H
3636
#include <unistd.h>
3737
#endif /* HAVE_UNISTD_H */
@@ -184,7 +184,7 @@ DGifOpenFileName(const char *FileName) {
184184
int FileHandle;
185185
GifFileType *GifFile;
186186

187-
#ifndef LINUX
187+
#ifndef __linux
188188
if ((FileHandle = open(FileName, O_RDONLY | O_BINARY)) == -1) {
189189
#else
190190
// TODO: Does this work?
@@ -1150,4 +1150,4 @@ DGifBufferedInput(GifFileType * GifFile,
11501150
}
11511151

11521152
return GIF_OK;
1153-
}
1153+
}

contrib/giflib/egif_lib_gcc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#ifdef HAVE_FCNTL_H
4747
#include <fcntl.h>
4848
#endif /* HAVE_FCNTL_H */
49-
#ifndef LINUX
49+
#ifndef __linux
5050
#ifdef HAVE_UNISTD_H
5151
#include <unistd.h>
5252
#endif /* HAVE_UNISTD_H */
@@ -107,15 +107,15 @@ EGifOpenFileName(const char *FileName,
107107
GifFileType *GifFile;
108108

109109
if (TestExistance)
110-
#ifndef LINUX
110+
#ifndef __linux
111111
FileHandle = open(FileName, O_WRONLY | O_CREAT | O_EXCL | O_BINARY
112112
#else
113113
// TODO: Does this work?
114114
FileHandle = open(FileName, O_WRONLY | O_CREAT | O_EXCL
115115
#endif
116116
, S_IREAD | S_IWRITE);
117117
else
118-
#ifndef LINUX
118+
#ifndef __linux
119119
FileHandle = open(FileName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY
120120
#else
121121
// TODO: Does this work?
@@ -167,7 +167,7 @@ EGifOpenFileHandle(int FileHandle) {
167167
return NULL;
168168
}
169169

170-
#ifndef LINUX
170+
#ifndef __linux
171171
setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
172172
#endif
173173

contrib/liblzma/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CFLAGS = -g -c -std=gnu99 -DHAVE__BOOL -DUNIX -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wno-implicit-function-declaration -pthread
1+
CFLAGS = -g -c -std=gnu99 -DHAVE__BOOL -D_FILE_OFFSET_BITS=64 -m64 -O2 -Wno-implicit-function-declaration -pthread
22
LIBLZMA_INCLUDES = -Iapi/ -Icheck/ -Icommon/ -Idelta/ -Ilz/ -Ilzma/ -Irangecoder/ -Isimple/
33
LIBLZMA_C = common/tuklib_physmem.c common/tuklib_cpucores.c common/common.c common/block_util.c common/easy_preset.c common/filter_common.c common/hardware_physmem.c common/index.c common/stream_flags_common.c common/vli_size.c common/alone_encoder.c common/block_buffer_encoder.c common/block_encoder.c common/block_header_encoder.c common/easy_buffer_encoder.c common/easy_encoder.c common/easy_encoder_memusage.c common/filter_buffer_encoder.c common/filter_encoder.c common/filter_flags_encoder.c common/index_encoder.c common/stream_buffer_encoder.c common/stream_encoder.c common/stream_flags_encoder.c common/vli_encoder.c common/hardware_cputhreads.c common/outqueue.c common/stream_encoder_mt.c common/alone_decoder.c common/auto_decoder.c common/block_buffer_decoder.c common/block_decoder.c common/block_header_decoder.c common/easy_decoder_memusage.c common/filter_buffer_decoder.c common/filter_decoder.c common/filter_flags_decoder.c common/index_decoder.c common/index_hash.c common/stream_decoder.c common/stream_buffer_decoder.c common/stream_flags_decoder.c common/vli_decoder.c check/check.c check/crc32_table.c check/crc32_fast.c check/crc64_table.c check/crc64_fast.c check/sha256.c lz/lz_encoder.c lz/lz_encoder_mf.c lz/lz_decoder.c lzma/lzma_encoder.c lzma/lzma_encoder_presets.c lzma/lzma_encoder_optimum_fast.c lzma/lzma_encoder_optimum_normal.c lzma/fastpos_table.c lzma/lzma_decoder.c lzma/lzma2_encoder.c lzma/lzma2_decoder.c rangecoder/price_table.c delta/delta_common.c delta/delta_encoder.c delta/delta_decoder.c simple/simple_coder.c simple/simple_encoder.c simple/simple_decoder.c simple/x86.c simple/powerpc.c simple/ia64.c simple/arm.c simple/armthumb.c simple/sparc.c
44

contrib/liblzma/Makefile.32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CFLAGS = -g -c -std=gnu99 -DHAVE__BOOL -DUNIX -D_FILE_OFFSET_BITS=64 -O2 -Wno-implicit-function-declaration -pthread
1+
CFLAGS = -g -c -std=gnu99 -DHAVE__BOOL -D_FILE_OFFSET_BITS=64 -O2 -Wno-implicit-function-declaration -pthread
22
LIBLZMA_INCLUDES = -Iapi/ -Icheck/ -Icommon/ -Idelta/ -Ilz/ -Ilzma/ -Irangecoder/ -Isimple/
33
LIBLZMA_C = common/tuklib_physmem.c common/tuklib_cpucores.c common/common.c common/block_util.c common/easy_preset.c common/filter_common.c common/hardware_physmem.c common/index.c common/stream_flags_common.c common/vli_size.c common/alone_encoder.c common/block_buffer_encoder.c common/block_encoder.c common/block_header_encoder.c common/easy_buffer_encoder.c common/easy_encoder.c common/easy_encoder_memusage.c common/filter_buffer_encoder.c common/filter_encoder.c common/filter_flags_encoder.c common/index_encoder.c common/stream_buffer_encoder.c common/stream_encoder.c common/stream_flags_encoder.c common/vli_encoder.c common/hardware_cputhreads.c common/outqueue.c common/stream_encoder_mt.c common/alone_decoder.c common/auto_decoder.c common/block_buffer_decoder.c common/block_decoder.c common/block_header_decoder.c common/easy_decoder_memusage.c common/filter_buffer_decoder.c common/filter_decoder.c common/filter_flags_decoder.c common/index_decoder.c common/index_hash.c common/stream_decoder.c common/stream_buffer_decoder.c common/stream_flags_decoder.c common/vli_decoder.c check/check.c check/crc32_table.c check/crc32_fast.c check/crc64_table.c check/crc64_fast.c check/sha256.c lz/lz_encoder.c lz/lz_encoder_mf.c lz/lz_decoder.c lzma/lzma_encoder.c lzma/lzma_encoder_presets.c lzma/lzma_encoder_optimum_fast.c lzma/lzma_encoder_optimum_normal.c lzma/fastpos_table.c lzma/lzma_decoder.c lzma/lzma2_encoder.c lzma/lzma2_decoder.c rangecoder/price_table.c delta/delta_common.c delta/delta_encoder.c delta/delta_decoder.c simple/simple_coder.c simple/simple_encoder.c simple/simple_decoder.c simple/x86.c simple/powerpc.c simple/ia64.c simple/arm.c simple/armthumb.c simple/sparc.c
44

contrib/liblzma/common/sysdefs_schnaader.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
#include <inttypes.h>
66

7-
#ifdef _MSC_VER
87
#define HAVE_STDBOOL_H
9-
#endif
108

11-
#ifdef UNIX
9+
#ifdef __unix
1210
#include <string.h>
1311
#define MYTHREAD_POSIX
1412
#else

0 commit comments

Comments
 (0)