Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with upstream #9

Merged
merged 4 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ src/util/Makefile
src/.accepted
src/depend
src/util/depend
build/*
!build/create_solution.bat
!build/README.md
15 changes: 15 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions build/create_solution.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake -B . -S ..\src -G "Visual Studio 17 2022"
26 changes: 26 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
3 changes: 1 addition & 2 deletions src/act.informative.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#include <sys/types.h>
#include "protocol.h"

#ifdef _MSC_VER
#include "telnet.h"
#define alloca _alloca
#endif

/******************************************************************************
The following section is for Diku/Merc derivatives. Replace as needed.
******************************************************************************/
Expand Down
6 changes: 5 additions & 1 deletion src/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,23 @@
#include <strings.h>
#endif

#include <stdlib.h> // prool for macos

#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
#include <stdlib.h>
//#include <stdlib.h> // prool

#else /* No standard headers. */

#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif

#if 0 // prool for macos
extern char *malloc(), *calloc(), *realloc();
extern void free ();

extern void abort (), exit ();
#endif

#endif /* Standard headers. */

Expand Down