From b6b8407c4fe81d6a0c1cc7318156755996741e7b Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 4 Jun 2019 01:43:34 +0000 Subject: [PATCH] cmm: Fix compilation under and for Linux. git-svn-id: svn://kolibrios.org@7666 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/cmm/Makefile | 2 +- programs/develop/cmm/Makefile_pyakov_ununtu32 | 3 ++- programs/develop/cmm/main.cpp | 5 ++++- programs/develop/cmm/port.h | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/programs/develop/cmm/Makefile b/programs/develop/cmm/Makefile index e2a66371ca..b4667588d8 100644 --- a/programs/develop/cmm/Makefile +++ b/programs/develop/cmm/Makefile @@ -19,7 +19,7 @@ Path_Libs = -Ld:/TEMP/Dev-Cpp/lib/kos -L $(SDK_DIR)/lib Add_Libs = #Link_Libs = -lc -lgcc -Link_Libs = -static -S -nostdlib -T $(SDK_DIR)/lib/app-dynamic.lds \ +Link_Libs = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app-dynamic.lds \ --image-base 0 -lgcc -ldll -lc.dll My_Libs = main.o port.o toka.o tokb.o tokc.o toke.o tokr.o errors.o debug.o outobj.o outpe.o disasm.o switch.o outle.o pointer.o new_type.o class.o res.o optreg.o libobj.o diff --git a/programs/develop/cmm/Makefile_pyakov_ununtu32 b/programs/develop/cmm/Makefile_pyakov_ununtu32 index ed0560e6d1..49e4361020 100644 --- a/programs/develop/cmm/Makefile_pyakov_ununtu32 +++ b/programs/develop/cmm/Makefile_pyakov_ununtu32 @@ -1,6 +1,7 @@ Compiler = gcc -Compiler_Options = -m32 -c -fno-exceptions -D_UNIX_ +Compatib_Posix = -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp +Compiler_Options = -m32 -c -fno-exceptions -D_UNIX_ $(Compatib_Posix) -Wno-narrowing #Compiler_Options = -c -fno-exceptions -O2 -D_WIN32_ #-D: _WIN32_ or _UNIX_ diff --git a/programs/develop/cmm/main.cpp b/programs/develop/cmm/main.cpp index ed0e8d6569..3333020b52 100644 --- a/programs/develop/cmm/main.cpp +++ b/programs/develop/cmm/main.cpp @@ -1682,7 +1682,10 @@ FILE *CreateOutPut(char *ext,char *mode) { char buf[256]; FILE *diskout; - sprintf(buf,"%s.%s",rawfilename,ext); + if (comfile == file_meos) + sprintf(buf,"%s",rawfilename); + else + sprintf(buf,"%s.%s",rawfilename,ext); if((diskout=fopen(buf,mode))==NULL){ ErrOpenFile(buf); exit(e_notcreateoutput); diff --git a/programs/develop/cmm/port.h b/programs/develop/cmm/port.h index c260e724ef..1a3ebf248f 100644 --- a/programs/develop/cmm/port.h +++ b/programs/develop/cmm/port.h @@ -90,12 +90,15 @@ bool OemToCharA(char*, char*); bool CharToOemA(char*, char*); int MultiByteToWideChar(unsigned int,unsigned int,char*,int,wchar_t *,int); +#else + +int stricmp(const char*, const char*); +int strnicmp(const char*, const char*, int); + #endif char* strupr(char* s); char* strlwr(char* s); -int stricmp(const char*, const char*); -int strnicmp(const char*, const char*, int); #ifdef _PORT_CPP_