ZDBSP Linux

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Chris
Posts: 2998
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

ZDBSP Linux

Post by Chris »

Okay. I finally got the code to compile under Linux, despite some warnings. Here's basically the rundown of what I did:
  • __int32 was not declared. Being VC only (or at least Win32 only), I just #defined it to an int for non-Win32 platforms. There's a better way to do that, but it works for now.
  • The exception class is in the std:: namespace. I simply added using std::exception; after the appropriate include in zdbsp.h.
  • The compiler didn't like throwing exception("Some string"); (no matching function for exception(const char[])..) I changed it to throw the strings themselves.
  • stricmp and strnicmp didn't exist. I added wrapper defines to strcasecmp and strncasecmp respectively for glibc.
  • Created a shell view.cpp for non-Win32 platforms.
As a bonus, I included timing via clock() for non-Win32, which seems to work just fine.

The remaining warnings are about using DWORDs where it's expecting long unsigned int, fixed_t where it wants long int, ect. Ignoreable warnings. A few were about checking unsigned values against >= 0 (which will always be true), and at least one was checking a signed short against an const (unsigned) WORD, which was set to 65535. Such a comparison is always false.

Barring those, the program still seemed to run. I tested it on slipgate.wad and seemed to do it's thing. Haven't been able to test the wad since I can't run ZDoom right yet, though.

One thing though, which seem to plague even the Windows build if it uses the same source.. the program left a stray SSECTORS file as well as a tmp.wad after running.

EDIT: Removed attachment. Look below for an update.
Last edited by Chris on Sun Apr 25, 2004 3:13 am, edited 1 time in total.
User avatar
Chris
Posts: 2998
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

A few correnctions. std::exception doesn't have a method to take a string as a parameter. I just changed it to std::runtime_error, which does take a string and is compatible with std::exception, and all seems well. Someone who knows more about C++ told me that just throwing the string wouldn't have the same effect as throwing a runtime error or exception. Also, there seems to be 2 unused C files, getopt.c and getoptl.c (along with getopt.h). Any reason for them being there? ZDBSP links just fine without them.. I'll upload a new version, that includes fewer warnings, right here. If you downloaded it already, redownload this.
You do not have the required permissions to view the files attached to this post.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany

Post by Hirogen2 »

FIrst to download.... YAY! Now this really becomes the ZNU (pun on GNU). What's still missing is the kernel :-P
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

You don't need the getopts under Linux because those are already part of glibc.

Return to “General”