Archvile
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Why I'm a Windows programmer
 
Author
All times are GMT. The time now is 04:59. Post New Thread    Post A Reply
Quasar
Moderator


Posts: 4615
Registered: 08-00


code:
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) IF (NOT HAVE_STDINT_H) IF (MSVC) ## FIXME: This is bad. stdint.h and inttypes.h should be ## moved to a seperate folder. They are not used by MinGW or ## in Visual Studio 2010 onwards, and break those builds. INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/source/win32/) ENDIF (MSVC) ENDIF (NOT HAVE_STDINT_H)

Why is this shit executing when the CMakeLists script is used in cygwin? I hate this kind of bullcrap. MSVC is not supposed to be defined on that platform.

Old Post 11-22-11 01:09 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
chungy
Doomworld is so about bullshit excuses


Posts: 1458
Registered: 06-05


What I gathered: You're a Windows programmer because you're having troubles compiling... on Windows.

In more seriousness, I would suspect it's defined to ease porting pre-existing Windows code bases.

Old Post 11-22-11 01:25 #
chungy is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
John Smith
not hobbs


Posts: 587
Registered: 05-07


Post would be better titled "Why I use MSVC in the Windows environment" because if you're a unix programmer that entire block of code means not a god damn thing, and if you're a cross platform programmer you can always make an MSVC project, and then that code still means not a god damn thing. Alternatively Quasar is post-title trolling.

Last edited by John Smith on 11-22-11 at 01:36

Old Post 11-22-11 01:31 #
John Smith is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00


code:
<ConSiGno> INCOMING PASTE <ConSiGno> In file included from /usr/include/cygwin/types.h:21, <ConSiGno> from /usr/include/sys/types.h:373, <ConSiGno> from /usr/include/stdio.h:46, <ConSiGno> from /home/caf/eternity/source/win32/i_cpu.cpp:35: <ConSiGno> /home/caf/eternity/source/win32/stdint.h:33:2: #error "Use this header only with Microsoft Visual C++ compilers!"

All I know is, this should not be happening, and I don't know how to fix it.

Old Post 11-22-11 01:39 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csonicgo
This post is probably useless


Posts: 3960
Registered: 03-04


the whole error if anyone cares:
code:
/home/caf/eternity/source/win32/i_cpu.cpp:32:2: #error This version of i_cpu.c is for Win32 only. In file included from /usr/include/cygwin/types.h:21, from /usr/include/sys/types.h:373, from /usr/include/stdio.h:46, from /home/caf/eternity/source/win32/i_cpu.cpp:35: /home/caf/eternity/source/win32/stdint.h:33:2: #error "Use this header only with Microsoft Visual C++ compilers!" In file included from /usr/include/cygwin/types.h:21, from /usr/include/sys/types.h:373, from /usr/include/stdio.h:46, from /home/caf/eternity/source/win32/i_cpu.cpp:35: /home/caf/eternity/source/win32/stdint.h:55: error: `__int8' does not name a type /home/caf/eternity/source/win32/stdint.h:56: error: `__int16' does not name a type /home/caf/eternity/source/win32/stdint.h:57: error: `__int32' does not name a type /home/caf/eternity/source/win32/stdint.h:59: error: `__int8' does not name a type /home/caf/eternity/source/win32/stdint.h:60: error: `__int16' does not name a type /home/caf/eternity/source/win32/stdint.h:61: error: `__int32' does not name a type /home/caf/eternity/source/win32/stdint.h:65: error: `int8_t' does not name a type /home/caf/eternity/source/win32/stdint.h:66: error: `int16_t' does not name a type /home/caf/eternity/source/win32/stdint.h:67: error: `int32_t' does not name a type /home/caf/eternity/source/win32/stdint.h:69: error: `uint8_t' does not name a type /home/caf/eternity/source/win32/stdint.h:70: error: `uint16_t' does not name a type /home/caf/eternity/source/win32/stdint.h:71: error: `uint32_t' does not name a type /home/caf/eternity/source/win32/stdint.h:75: error: `int8_t' does not name a type /home/caf/eternity/source/win32/stdint.h:76: error: `int16_t' does not name a type /home/caf/eternity/source/win32/stdint.h:77: error: `int32_t' does not name a type /home/caf/eternity/source/win32/stdint.h:79: error: `uint8_t' does not name a type /home/caf/eternity/source/win32/stdint.h:80: error: `uint16_t' does not name a type /home/caf/eternity/source/win32/stdint.h:81: error: `uint32_t' does not name a type make[2]: *** [source/CMakeFiles/eternity.dir/win32/i_cpu.o] Error 1 make[1]: *** [source/CMakeFiles/eternity.dir/all] Error 2 make: *** [all] Error 2

Old Post 11-22-11 01:43 #
Csonicgo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
andrewj
Senior Member


Posts: 1380
Registered: 04-02


Try including <windows.h> before standard headers, and it seems silly to test for _WIN32 before including windows.h (that is where it gets defined, right?)

Old Post 11-22-11 12:05 #
andrewj is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
wesleyjohnson
Member


Posts: 486
Registered: 04-09


I do not do much Windows, so I am no expert, but I had to go through this for MinGW on Win98. I am assuming those are precompiler macro names.

Try (substitute your preprocessor or compiler for gcc)
> touch dummy.h
> gcc -dM dummy.h > dummy.txt

to see what that compiler thinks it is. It is even possible that you are not getting the compiler that you thought you were.
Look for the VERSION macro.

I thought MSVC was Microsoft-visual-c, which would not be that amazing that some Windows c compiler thinks it can compile it. For a unix system (from those path names it looks like unix), it would be a bit strange. A compiler defining a macro like MSVC is like all gnu C compilers defining __GNU_C__. You might have to find a more specific macro name to identify the compiler. Look for a __MSVC__.

I got an Ada GNAT compiler on a MAC that compiles C using GCC, and giving macros identical to it (except for one VERSION string).

Last edited by wesleyjohnson on 11-22-11 at 21:53

Old Post 11-22-11 21:40 #
wesleyjohnson is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 8664
Registered: 07-06


More like "Why am I a Windows programmer?"

Old Post 11-24-11 07:28 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03



Maes said:
More like "Why am I a Windows programmer?"



I actually think what he meant is that someone programming for Windows only wouldn't have to bother with all this crap.

Old Post 11-24-11 07:35 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
MP2E
Junior Member


Posts: 114
Registered: 09-07


But you would, provided someone tried to compile on Cygwin, which is Windows only. You could argue the same if you tried to write it Linux only, then you wouldn't have to deal with all the different Windows compilers and defines one might be using(VC++ 2005,08,11 GCC 3.X, 4.X, MinGW, MinGW64(different projects), and Cygwin). Compare this to supporting back to maybe GCC 4.2 and making sure it compiled up to GCC 4.6 on Linux. One compiler, just different versions. At most you might need to support clang too, which is pretty much fully gcc compatible.

Old Post 11-24-11 10:27 #
MP2E is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


Why should I bother with a MinGW setup? It's only added work for no real benefit in a Windows only project.

VC++ Express can be downloaded free of charge so it's not that by making a VC only project that someone can't use it for other reasons as stubbornness to install the required software.

Old Post 11-24-11 11:19 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
_bruce_
Forum Regular


Posts: 799
Registered: 11-07



Graf Zahl said:
Why should I bother with a MinGW setup? It's only added work for no real benefit in a Windows only project.

VC++ Express can be downloaded free of charge so it's not that by making a VC only project that someone can't use it for other reasons as stubbornness to install the required software.



Absolutely agree - never understood the 'free willy' attitude of making something complicated.
Only idea I could follow is an extra option without having to resort to MS software - from a freedom perspective understandable.

Old Post 11-24-11 11:28 #
_bruce_ is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 8664
Registered: 07-06



Graf Zahl said:
VC++ Express can be downloaded free of charge so it's not that by making a VC only project that someone can't use it for other reasons as stubbornness to install the required software.


Compulsory registration is a minor turndown, albeit I guess you could always "warez" your way into obtaining a key. Would it still be considered warez since there's no charge involved (other than your personal data and needing to have an MS Live/Hotmail account)

Old Post 11-24-11 12:00 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
hex11
Senior Member


Posts: 1485
Registered: 09-09


In general, I don't like GUI tools (except for stuff like graphics programs, Doom map editor, etc), so at my previous job I installed cygwin and other similar CLI stuff on the WinXP laptop they allocated for me to use. Eventually though I just repartitioned the damned thing and installed a nicer OS that came with lots more dev tools in the base system, and thousands more available instantly via the package manager. The only time I rebooted into XP was to use their crazy, proprietary version control system that only worked in Win32 (and had the clumsiest interface I'd ever seen). Many times I didn't check my code back in until several projects were completed (less time wasted that way). For the intermediate steps, I just used a personal CVS repo on one of their Linux servers.

Old Post 11-24-11 13:52 #
hex11 is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03



Maes said:


Compulsory registration is a minor turndown.



So what? They know I use it. Big deal! Programming is my job so nothing I wouldn't mind other people to know.

Old Post 11-24-11 15:02 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00


Especially when you can register the software to Poopie McFarthead who lives at the South Pole and trains penguins to fetch beer from the fridge.

Old Post 11-24-11 16:38 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 8664
Registered: 07-06


To even log in to the registering procedure you gotta have a valid Hotmail/Live account. Unless you ALSO registered that one as Poopie McFarthead. And despite that, they still ask a crapload of data which they could've lifted off your account anyway, plus some more.

Old Post 11-24-11 16:52 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7130
Registered: 01-03


The software you get for that info (not that I provided anything of use except my name) is more than worth it.

Old Post 11-24-11 18:47 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
wesleyjohnson
Member


Posts: 486
Registered: 04-09


Did a grep of the /usr/include files to see what they use to detect MSVC. MSVC is mentioned, but not tested anywhere I saw.
I think it they were testing _MSC_VER to detect that compiler (better check for yourself).
They must know something.

Old Post 11-25-11 03:21 #
wesleyjohnson is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00


It is not a compiler problem. It is a problem with the CMake script.

Old Post 11-25-11 05:55 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Yagisan
Mini-Member


Posts: 94
Registered: 01-06



Quasar said:
code:
CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) IF (NOT HAVE_STDINT_H) IF (MSVC) ## FIXME: This is bad. stdint.h and inttypes.h should be ## moved to a seperate folder. They are not used by MinGW or ## in Visual Studio 2010 onwards, and break those builds. INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR}/source/win32/) ENDIF (MSVC) ENDIF (NOT HAVE_STDINT_H)

Why is this shit executing when the CMakeLists script is used in cygwin? I hate this kind of bullcrap. MSVC is not supposed to be defined on that platform.



I wrote this code.

MSVC IS NOT defined when building with Cygwin.

The problem you have is clearly listed in the comments. I brought it up with you when I wrote the code. You include your own copies of stdint.h and inttypes.h in source/win32 - this include path is added to your search directory when trunk/source/CMakeLists.txt is parsed. I did not test cygwin at the time, if I had, it would also be listed as broken in the comments.

The solution now, is the same as I proposed when I wrote the code. Move the replacement stdint.h and inttypes.h to another directory, so it doesn't break on MinGW, Cygwin, VS2010+ - yes this will involve a small patch to the CMakeLists.txt to include the new directory for old MSVC compilers.

Old Post 11-25-11 06:40 #
Yagisan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csonicgo
This post is probably useless


Posts: 3960
Registered: 03-04



Yagisan said:


I wrote this code.

MSVC IS NOT defined when building with Cygwin.

The problem you have is clearly listed in the comments. I brought it up with you when I wrote the code. You include your own copies of stdint.h and inttypes.h in source/win32 - this include path is added to your search directory when trunk/source/CMakeLists.txt is parsed. I did not test cygwin at the time, if I had, it would also be listed as broken in the comments.

The solution now, is the same as I proposed when I wrote the code. Move the replacement stdint.h and inttypes.h to another directory, so it doesn't break on MinGW, Cygwin, VS2010+ - yes this will involve a small patch to the CMakeLists.txt to include the new directory for old MSVC compilers.



THANK YOU

Old Post 11-25-11 10:00 #
Csonicgo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



Csonicgo said:


THANK YOU


I already knew the fix to this the night you left saying you wouldn't have time to test it. Yagisan and I discussed it in IRC and he thinks the same thing I thought - the line of code adding /source/win32 as an include directory in /source/CMakeLists.txt is unnecessary.

So, please get your ass back in IRC.

Old Post 11-25-11 17:44 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csonicgo
This post is probably useless


Posts: 3960
Registered: 03-04



Quasar said:

I already knew the fix to this the night you left saying you wouldn't have time to test it. Yagisan and I discussed it in IRC and he thinks the same thing I thought - the line of code adding /source/win32 as an include directory in /source/CMakeLists.txt is unnecessary.

So, please get your ass back in IRC.



I won't be around during the holidays.

Old Post 11-25-11 19:43 #
Csonicgo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 04:59. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Why I'm a Windows programmer

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory