09 Nov, 2011, Kline wrote in the 21st comment:
Votes: 0
I haven't browsed many other bases in depth, but ACK!MUD only has relics of that type of OS checking in the oldest of versions. Everything else was moved forward to use specified defines such as WIN32, CYGWIN, etc, all declared in the Makefile and handed to GCC as Runter suggests. It easily removes all ambiguity from figuring out if a given platform will respond properly to a #define you have established.
09 Nov, 2011, arholly wrote in the 22nd comment:
Votes: 0
OK, so, what I am hearing is that it is best to move all that talking about the OS to the makefile and minimize the amount of declares in the .h file. I guess it really does not matter, but was more a matter of making the code a bit tighter. But I look at it and even the latest version of ackfuss has the same things declared the same way, so I guess it's all academic, but a good learning experience.
09 Nov, 2011, Runter wrote in the 23rd comment:
Votes: 0
arholly said:
OK, so, what I am hearing is that it is best to move all that talking about the OS to the makefile and minimize the amount of declares in the .h file. I guess it really does not matter, but was more a matter of making the code a bit tighter. But I look at it and even the latest version of ackfuss has the same things declared the same way, so I guess it's all academic, but a good learning experience.


Maybe the code is the same, but if your makefile passes -D linux to the compiler it's certainly defined. And based on what Kline said, that's probably what it's doing.
10 Nov, 2011, Kline wrote in the 24th comment:
Votes: 0
Runter said:
arholly said:
OK, so, what I am hearing is that it is best to move all that talking about the OS to the makefile and minimize the amount of declares in the .h file. I guess it really does not matter, but was more a matter of making the code a bit tighter. But I look at it and even the latest version of ackfuss has the same things declared the same way, so I guess it's all academic, but a good learning experience.


Maybe the code is the same, but if your makefile passes -D linux to the compiler it's certainly defined. And based on what Kline said, that's probably what it's doing.

Yes, AckFUSS does have defines for system dependent pieces in places (Cygwin/Win32). However, as Runter pointed out, they are toggled within the Makefile.
10 Nov, 2011, Tyche wrote in the 25th comment:
Votes: 0
When you use the -ansi switch, unix is undefined.
Use __unix__ instead.
10 Nov, 2011, Joseph Locke wrote in the 26th comment:
Votes: 0
Just curious, why might one assume unix to be defined under the -ansi switch? Platform specific declarations are normally avoided in the standard, right?

Why __unix__? So saying, you would end up with something like #if defined(__unix__)?

(I think I have seen #ifdef __unix__ more than anything.)
10 Nov, 2011, Tyche wrote in the 27th comment:
Votes: 0
The standards (ANSI/ISO) only define what macros must be defined.
The GCC compiler always has both unix and __unix__ defined,
but only __unix__ defined when -ansi switch is on.
I doubt they even know why, or have a meaningful reason.
There's also __unix, and if you wanted to be somewhat safe you'd check to see if any were defined.
And then you'd still be wrong because some unix compilers don't define any of them.
10 Nov, 2011, Joseph Locke wrote in the 28th comment:
Votes: 0
Oh, I see. Well, that sort of clarifies things. Thanks, Tyche.
20.0/28