mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
[ctrtool] Fix compile errors
And comparisons which would have always returned false.
This commit is contained in:
+18
-3
@@ -3,12 +3,27 @@ SRC_DIR = . polarssl tinyxml
|
||||
OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) $(foreach dir,$(SRC_DIR),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp)))
|
||||
|
||||
# Compiler Settings
|
||||
LIBS = -static-libgcc -static-libstdc++
|
||||
CXXFLAGS = -I.
|
||||
CFLAGS = -O2 -flto -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -I.
|
||||
OUTPUT = ctrtool
|
||||
CXXFLAGS = -I.
|
||||
CFLAGS = -O2 -flto -Wall -Wno-unused-variable -Wno-unused-result -I.
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
ifeq ($(OS),Windows_NT)
|
||||
#Windows Build CFG
|
||||
CFLAGS += -Wno-unused-but-set-variable
|
||||
LIBS += -static-libgcc -static-libstdc++
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
# OS X
|
||||
CFLAGS += -Wno-unused-local-typedef
|
||||
LIBS += -liconv
|
||||
else
|
||||
# Linux
|
||||
CFLAGS += -Wno-unused-but-set-variable
|
||||
LIBS +=
|
||||
endif
|
||||
endif
|
||||
|
||||
main: $(OBJS)
|
||||
$(CXX) -o $(OUTPUT) $(LIBS) $(OBJS)
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ int stream_out_flush(stream_out_context* ctx)
|
||||
if (ctx->outbufferpos > 0)
|
||||
{
|
||||
size_t writtenbytes = fwrite(ctx->outbuffer, 1, ctx->outbufferpos, ctx->outfile);
|
||||
if (writtenbytes < 0)
|
||||
if (writtenbytes == 0) // will be zero if nothing is written
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
+4
-2
@@ -46,8 +46,10 @@ inline int fseeko64(FILE *__stream, long long __off, int __whence)
|
||||
{
|
||||
return _fseeki64(__stream, __off, __whence);
|
||||
}
|
||||
#else
|
||||
extern int fseeko64 (FILE *__stream, off64_t __off, int __whence);
|
||||
#elif __APPLE__
|
||||
#define fseeko64 fseek // OS X file I/O is 64bit
|
||||
#elif __linux__
|
||||
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user