Friday, November 24, 2017

Setting Up the Enviroment

My first goal was to pull the code for ROE into a modern development environment. Even though I want to use POSIX as my baseline, I decided to pick Visual Studio 2015 as my IDE. It has a few things going for it. First, some of the legacy headers originally developed for QuickC are still hanging around. Direct.h is one example (used for directory management). However, it appears that Allegro also has wrappers for filesystems too. I may have to do a pass to see if most of my POSIX stuff may have an Allegro equivalent. I may have to retarget later on.

The Allegro libraries are available via NuGet, which makes life much easier. On a previous project, I literally spent two days trying to get Allegro to work with Code::Blocks under Win10, which is my preferred IDE for GCC. Visual Studio is great, but it’s compiler has some glaring deficiencies. Two of my favorites is as follows:

1) In 2017, MSVC STILL can not process Unicode string literals. You want to see the IDE go bananas? Plop an emoji into the source. (It’s a valid Unicode character). It will stop everything telling you that there is an invalid character from the current codepage and it’s unable to save. That’s right, Microsoft still uses codepages for non-Latin text. This shouldn’t be a huge problem as I don’t plan on using Unicode (for now)


2) Microsoft absolutely, positively refuses to support C99 and above. It’s considers C a “deprecated” language. Now I know that this may seem a strange thing for whine about, as C++ is a superset of C. However there exists little things that can be irksome such as.

-Bool support (Not really needed as the ROE typedef’ed it’s own Boolean type.)

-Universal character names, for example...
 int 番号 = 1;
 ..is invalid. That's might be a good thing though.

-Variable length arrays

-Etc…

To Microsoft’s credit, they recommend that if you need to use an actual C compiler, it does have front-end support for Clang. As ROE was written in 1991, I don’t think I need to rip out half my toolchain be able to create obnoxious variable names.

Other than that, I’ve also put the code into an honest-to-goodness version control system. The Git support in 2015 is pretty sweet. I’m keeping the repo local for now, I can probably spin up a git server on a Linux kick-box I have hanging around if I feel inclined to work remotely.

One of the last things I’ve also set up is Doxygen. It basically scans the source tree and auto-generates documentation so I can follow where everything is. ROE was written before Object Orientated Programming was a mainstream thing. Globals Globals Gobals! Lots of them. Encapsulation? What’s that? Doxygen helps by giving me a local web-based source code search engine. I don’t have to put on snorkel gear and dive in to see where some pesky extern was declared at. I'm planning to merge into Doxygen most of the documenttation that was graciously given to me by OTSW. This means not only will there be living, portable code, but with plethora of inline documentation to go with it.

Looking good so far.

No comments:

Post a Comment