the-cold-dark / genesis

The Cold server - This implements a dynamic, object-oriented language on top of an object database, well suited for virtual environments and online servers (like games).
29 stars 7 forks source link

Update to build with C99 or C11 #9

Closed waywardmonkeys closed 1 year ago

waywardmonkeys commented 1 year ago

In CMakeLists.txt, we need to add this:

SET(CMAKE_C_STANDARD 11)
SET(CMAKE_C_STANDARD_REQUIRED ON)
SET(CMAKE_C_EXTENSIONS OFF)

We have to build allowing extensions for now or fix things to build since we use inet_aton, gethostname, etc and these aren't available without enabling a build flag / definition.

Once we do this, we can look at changing code to be more concise (like not always declaring variables at the top of the function).

We can also the start to use C99 inline function semantics which will help us fix some bottlenecks when doing a textdump round trip for The Eternal City or Grendel's Revenge.