VOGONS


Visual Studio .NET 2005 beta2

Topic actions

First post, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Well...since M$ apparently decided to declare VS beta2 as stable I said why not give it a try compiling dosbox. The compiler is supposedly much improved...but there are (look, surprise) a lot of errors.

include\setup.h(69) : error C4980: '__value' : use of this keyword requires /clr:oldSyntax command line option
include\setup.h(71) : error C2059: syntax error : '__value'
include\setup.h(71) : error C2208: 'Value' : no members defined using this type
include\setup.h(69) : error C3630: error when processing the token '__value'
setup.h(69) : fatal error C1190: managed targeted code requires a '/clr' option

of course...setting /clr:oldSyntax will list some other errors...

cl : Command line error D8045 : cannot compile C file '..\src\platform\visualc\dirent.c' with the /clr option

just in case if .net 2005 is going to be a supported platform sometime in the future 😉

Reply 1 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm it seems some anonymous structure thing ?
(first guess) Should take a look at the exact code present there

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 31, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

I guess I gave up to soon 😁. Seems the __value is a reserved keyword now so line 71 in setup.h does not work:

Value __value;

the name of the variable should be changed to something else. I replaced all occurences of __value in setup.h and setup.cpp with something else. The next problem is that strchr() seems to return const char* now. There are 3 errors:

sdlmain.cpp, 798
dos_ioctl.cpp, 107
drive_cache.cpp, 318

I replaced those variables with const char* (and removed that *height=0 in sdlmain.cpp) as a quick fix. It now compiles fine 😀. I had to add some libs or it wouldn't link, but that's probably because beta2 does not include platform sdk. I'll do some tests to see if the resulting binary works and how fast it is 😁

Reply 3 of 31, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Well, names starting with double-underscore are reserved for the C compiler/runtime, so it's hardly surprising. User code shouldn't use such names. 😀

Reply 4 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

will update the setup.* then.

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 31, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

heh...great...cvs now seems to compile with vs 2005 😀. However, there a million dollar question...how come none of the other strchr() calls bother the compiler? 😁

Reply 6 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

well we use strrchr more (reverse search)

but it's a bit odd as my manpage clearly states it returning a pointer to char
and not a pointer to a constant char.

I hope they don't turn all string functions to const variants

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 31, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Perhaps they have two versions, implicitly overloaded: feed it a const char* and get a const char back, feed it a char* and get a char*. Would actually be a quite sensible thing to do.

Reply 8 of 31, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

while preparing for .net 2005, I noticed a strange behavior with my .net 2003: if at a certain point of a piece of code a variable called "attr" is declared, any following variable and function will be visualized in the ide of the type of attr. Yes, this is not a big problem, but prevents the ide from using the "Go to definition" function, which I find useful.
Does anyone else with .net 2003 have this problem?

Reply 9 of 31, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yep, MSVC (2003) doesn't like variables called "attr".

wd

Reply 10 of 31, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

Just tried VS 2005 Beta 2 with latest cvs. This patch makes minor changes to make it fully compatible:
-src/dos/scsidefs.h ported to dos standard CR/LF line termination
-src/dos/cdrom_image.cpp fixed "const char * file" issue
-src/gui/sdlmain.cpp fixed ifdef HAVE_DDRAW_H issue

Reply 11 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

src/dos/scsidefs.h ported to dos standard CR/LF line termination

Your cvs client should take care of that.
all files in dosbox are stored in unix format. (as the cvs is on a linux server). Cvs clients should convert the file when check it out.
Maybe the current file is of mixed type, which messes up the cvs client.

Water flows down the stream
How to ask questions the smart way!

Reply 12 of 31, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

Your cvs client should take care of that.

actually it's quite strange, i just did a cvs checkout
maybe a bug into win32 cvs tool? 😕

Reply 13 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm no. the file was stored in cr/lf on the server somehow. mixed stuff.
I commited it again in unix format. it should be allright now

Water flows down the stream
How to ask questions the smart way!

Reply 14 of 31, by twistedemotions

User metadata
Rank Newbie
Rank
Newbie

Neat! I wonder if Dosbox would compile with Intels C++ Compiler 9.0

The 10% performance increase would be worthless for most apps, but maybe it could help with games like System Shock.

Reply 15 of 31, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

yes it compiles. takes a long time though

Water flows down the stream
How to ask questions the smart way!

Reply 16 of 31, by ASM

User metadata
Rank Newbie
Rank
Newbie

I don't know about v9.0 but with v8.x you need a lot of RAM if you want to compile it with WPO enabled. I tried it with my 512MB notebook and after some time it canceled compilation with an out-of-memory error.

Reply 17 of 31, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

@Qbix: Those changes from kekko are not in cvs 😕. cdrom_image.cpp will not compile in vs.net 2005. HAVE_DDRAW_H issue should also be fixed if platform/visualc/config.h specifies HAVE_DDRAW_H as 1 and 0.

Reply 19 of 31, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

hmm...there's still one defined(HAVE_DDRAW_H) left in sdlmain.cpp at line 268