From 498b6525460180f47d72dbfbade61fa1650d6f19 Mon Sep 17 00:00:00 2001 From: Serge Date: Sat, 7 Jan 2023 16:43:06 +0200 Subject: [PATCH 1/3] fixed small bug in toggle showvnum (#125) Thanks, @prool --- src/act.informative.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/act.informative.c b/src/act.informative.c index e5db496ec..79705f3be 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -519,7 +519,7 @@ void look_at_room(struct char_data *ch, int ignore_brief) send_to_char(ch, "]"); } } - else { + else send_to_char(ch, "%s", world[IN_ROOM(ch)].name); send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM)); @@ -538,7 +538,6 @@ void look_at_room(struct char_data *ch, int ignore_brief) /*now list characters &objects */ list_obj_to_char(world[IN_ROOM(ch)].contents, ch, SHOW_OBJ_LONG, FALSE); list_char_to_char(world[IN_ROOM(ch)].people, ch); - } } static void look_in_direction(struct char_data *ch, int dir) From 6826b1a1483420a20b5e836c308ec721c13a76f3 Mon Sep 17 00:00:00 2001 From: prool Date: Sat, 7 Jan 2023 20:37:42 +0200 Subject: [PATCH 2/3] MODIF: adaptation for macOS --- src/sysdep.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sysdep.h b/src/sysdep.h index b7e554256..08f566b36 100644 --- a/src/sysdep.h +++ b/src/sysdep.h @@ -78,8 +78,10 @@ #include #endif +#include // prool for macos + #if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)) -#include +//#include // prool #else /* No standard headers. */ @@ -87,10 +89,12 @@ #include #endif +#if 0 // prool for macos extern char *malloc(), *calloc(), *realloc(); extern void free (); extern void abort (), exit (); +#endif #endif /* Standard headers. */ From b2d38522e01203d61a12546a806457c022aa6d0d Mon Sep 17 00:00:00 2001 From: Roman Shapiro Date: Sun, 19 Nov 2023 10:04:39 +0700 Subject: [PATCH 3/3] Added new easy way of building TbaMUD in the Visual Studio through the CMake (#127) * Added new experimental MSVC build way through CMake * Small build/README.md fix --- .gitignore | 3 +++ build/README.md | 15 +++++++++++++++ build/create_solution.bat | 1 + src/CMakeLists.txt | 26 ++++++++++++++++++++++++++ src/protocol.c | 5 +++++ 5 files changed, 50 insertions(+) create mode 100644 build/README.md create mode 100644 build/create_solution.bat create mode 100644 src/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 35c0bede2..e8e8f46fc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ src/util/Makefile src/.accepted src/depend src/util/depend +build/* +!build/create_solution.bat +!build/README.md \ No newline at end of file diff --git a/build/README.md b/build/README.md new file mode 100644 index 000000000..bd84d9ac6 --- /dev/null +++ b/build/README.md @@ -0,0 +1,15 @@ +### Overview +This guide describes how to build TbaMUD in the Visual Studio through the new experimental CMake environment. + +### Prerequisites +* [Visual Studio 2022+](https://visualstudio.microsoft.com/ru/vs/) +* [CMake 3.27+](https://cmake.org/) + +### Build Steps +1. Goto the folder `src` and copy `conf.h.win` to `conf.h`. + +2. Goto the folder `build` and execute `create_solution.bat`. + +3. Open `build/circle.sln` in Visual Studio. + +4. Compile and run. \ No newline at end of file diff --git a/build/create_solution.bat b/build/create_solution.bat new file mode 100644 index 000000000..ab6004308 --- /dev/null +++ b/build/create_solution.bat @@ -0,0 +1 @@ +cmake -B . -S ..\src -G "Visual Studio 17 2022" \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..51832b408 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.27) + +# Set the project name +project(circle) + +# Global definitions +if(MSVC) + # using Visual Studio C++ + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) +endif() + +# circle itself +file(GLOB CIRCLE_SOURCES + "*.h" + "*.c" +) + +add_executable(circle ${CIRCLE_SOURCES}) + +if(MSVC) + target_link_libraries(circle wsock32.lib) + + set_target_properties(circle PROPERTIES + VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/.." + ) +endif() \ No newline at end of file diff --git a/src/protocol.c b/src/protocol.c index e2beac34b..587e6acc8 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -13,6 +13,11 @@ #include #include "protocol.h" +#ifdef _MSC_VER +#include "telnet.h" +#define alloca _alloca +#endif + /****************************************************************************** The following section is for Diku/Merc derivatives. Replace as needed. ******************************************************************************/