gamedevlists-windows Mailing List for gamedev (Page 12)
Brought to you by:
vexxed72
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(58) |
Nov
(49) |
Dec
(38) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(124) |
Feb
(83) |
Mar
(17) |
Apr
(37) |
May
(12) |
Jun
(20) |
Jul
(47) |
Aug
(74) |
Sep
(62) |
Oct
(72) |
Nov
(54) |
Dec
(13) |
2003 |
Jan
(36) |
Feb
(8) |
Mar
(38) |
Apr
(3) |
May
(6) |
Jun
(133) |
Jul
(20) |
Aug
(18) |
Sep
(12) |
Oct
(4) |
Nov
(28) |
Dec
(36) |
2004 |
Jan
(22) |
Feb
(51) |
Mar
(28) |
Apr
(9) |
May
(20) |
Jun
(9) |
Jul
(37) |
Aug
(20) |
Sep
(23) |
Oct
(15) |
Nov
(23) |
Dec
(27) |
2005 |
Jan
(22) |
Feb
(20) |
Mar
(5) |
Apr
(14) |
May
(10) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(12) |
Nov
(1) |
Dec
|
2006 |
Jan
(18) |
Feb
(4) |
Mar
(3) |
Apr
(6) |
May
(4) |
Jun
(3) |
Jul
(16) |
Aug
(40) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(2) |
2007 |
Jan
(5) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(13) |
Jun
|
Jul
(26) |
Aug
(3) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(5) |
2008 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel V. <Dan...@ep...> - 2005-01-08 22:18:18
|
There are a couple of cases where VS.NET doesn't pick up correctly on changes and you need to manually perform a full rebuild/ relink. And there are a few cases where updating project files via source control while VS.NET is running doesn't work reliably and you need to re-open the solution. Having incremental linking enabled is another source for potential issues that go away with full rebuilds. I usually just re-open the solution and do a full rebuild whenever I get really bizarre problems that *shouldn't* happen :) -- Daniel, Epic Games Inc. =20 > -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of Brett Bibby > Sent: Saturday, January 08, 2005 1:01 AM > To: gam...@li... > Subject: Re: [GD-Windows] declspec? >=20 > So I booted MSVC to build and get the error to post here, and=20 > the error went > away. Another programmer verified the error magically=20 > disappeared on his > machine too. Classic. We had created a new project to test out some > multiplatform code and without quitting put all the code in=20 > and got the > errors. Somehow quitting and reloading the project fixed it. sigh. >=20 > ----- Original Message -----=20 > From: "Alen Ladavac" <ale...@cr...> > To: <gam...@li...> > Sent: Friday, January 07, 2005 5:37 PM > Subject: Re: [GD-Windows] declspec? >=20 >=20 > > Those are only for dlls, not for static libraries. Static=20 > libraries don't > > need any special declarations. What exactly does the linker say? > > > > Alen > > > > ----- Original Message ----- > > From: "Brett Bibby" <res...@ga...> > > To: <Gam...@li...> > > Sent: Friday, January 07, 2005 2:24 AM > > Subject: [GD-Windows] declspec? > > > > > > > Can someone explain to me when and how to use the=20 > __declspec(dllimport) > > and > > > __declspec(dllexport) specifiers? > > > > > > We have a few libraries that are statically linked to the=20 > game. In > > > CodeWarrior this has always worked. We tried to build a=20 > MSVC project > and > > > the linker complains. Only when we put=20 > __declspec(dllexport) in the > class > > > declarations will it compile. I checked the MSDN doc and=20 > it's not very > > > clear what's needed for static libraries. This must be a=20 > basic thing I > > > guess, but I have always used CodeWariror and never seen=20 > this kind of > > > problem. > > > > > > Cheers, > > > -bb > > > > > > > > > > > > ------------------------------------------------------- > > > The SF.Net email is sponsored by: Beat the post-holiday blues > > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > > It's fun and FREE -- well,=20 > almost....http://www.thinkgeek.com/sfshirt > > > _______________________________________________ > > > Gamedevlists-windows mailing list > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > > > > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well,=20 > almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 |
From: Brett B. <res...@ga...> - 2005-01-08 05:45:07
|
So I booted MSVC to build and get the error to post here, and the error went away. Another programmer verified the error magically disappeared on his machine too. Classic. We had created a new project to test out some multiplatform code and without quitting put all the code in and got the errors. Somehow quitting and reloading the project fixed it. sigh. ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: <gam...@li...> Sent: Friday, January 07, 2005 5:37 PM Subject: Re: [GD-Windows] declspec? > Those are only for dlls, not for static libraries. Static libraries don't > need any special declarations. What exactly does the linker say? > > Alen > > ----- Original Message ----- > From: "Brett Bibby" <res...@ga...> > To: <Gam...@li...> > Sent: Friday, January 07, 2005 2:24 AM > Subject: [GD-Windows] declspec? > > > > Can someone explain to me when and how to use the __declspec(dllimport) > and > > __declspec(dllexport) specifiers? > > > > We have a few libraries that are statically linked to the game. In > > CodeWarrior this has always worked. We tried to build a MSVC project and > > the linker complains. Only when we put __declspec(dllexport) in the class > > declarations will it compile. I checked the MSDN doc and it's not very > > clear what's needed for static libraries. This must be a basic thing I > > guess, but I have always used CodeWariror and never seen this kind of > > problem. > > > > Cheers, > > -bb > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Alen L. <ale...@cr...> - 2005-01-07 09:38:03
|
Those are only for dlls, not for static libraries. Static libraries don't need any special declarations. What exactly does the linker say? Alen ----- Original Message ----- From: "Brett Bibby" <res...@ga...> To: <Gam...@li...> Sent: Friday, January 07, 2005 2:24 AM Subject: [GD-Windows] declspec? > Can someone explain to me when and how to use the __declspec(dllimport) and > __declspec(dllexport) specifiers? > > We have a few libraries that are statically linked to the game. In > CodeWarrior this has always worked. We tried to build a MSVC project and > the linker complains. Only when we put __declspec(dllexport) in the class > declarations will it compile. I checked the MSDN doc and it's not very > clear what's needed for static libraries. This must be a basic thing I > guess, but I have always used CodeWariror and never seen this kind of > problem. > > Cheers, > -bb > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Brett B. <res...@ga...> - 2005-01-07 01:08:52
|
Can someone explain to me when and how to use the __declspec(dllimport) and __declspec(dllexport) specifiers? We have a few libraries that are statically linked to the game. In CodeWarrior this has always worked. We tried to build a MSVC project and the linker complains. Only when we put __declspec(dllexport) in the class declarations will it compile. I checked the MSDN doc and it's not very clear what's needed for static libraries. This must be a basic thing I guess, but I have always used CodeWariror and never seen this kind of problem. Cheers, -bb |
From: Richard F. <ra...@gm...> - 2005-01-06 10:29:23
|
thanks, of course now that we all look like fools i must wipe all of your minds with our deneuraliser.... <phzzzt> bugger. On Wed, 5 Jan 2005 13:46:44 -0800, Andy Glaister <an...@mi...> wrote: > HKLM\Software\Microsoft\Windows > NT\CurrentVersion\AeDebug\UserDebuggerHotKey > > This contains the virtual keycode for the key (0 default, F12) - 0xff > should disable the key. I believe you have to reboot before this takes > effect. > > Andy. > > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On Behalf Of > Mat Noguchi (BUNGIE) > Sent: Wednesday, January 05, 2005 10:03 AM > To: gam...@li... > Subject: RE: [GD-Windows] Press F12 to crash... > > http://support.microsoft.com/support/kb/articles/q130/6/67.asp > > This is intentional. It does not happen if the application is not being > debugged. > > MSN > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On Behalf Of > Richard Fabian > Sent: Wednesday, January 05, 2005 9:20 AM > To: gamedevwindows > Subject: [GD-Windows] Press F12 to crash... > > Have just been informed by my mates that f12 crashes our game... i was > a bit worried.. so I went on a hunt.. eventually found that the crash > could be hit even before our game came up, so, me being who i am, > booted up the hello world wizard in VC6, and compiled it... and ran > the exe... pressed F12... and boom. > > As you can imagine, i was puzzled by this behaviour... especially as > some of us use .NET and some use VC6 (like myself), and we tried to > attribute this problem to directinput until i pointed out that the > hello world app doesn;t use DirectX... > > Anyone come across anything similar? the only thing we all seem to > have in common is that we are running XP sp2... > > I am even running a different Platform SDK from them. > > very odd. > > yours befuddledly: fabs(); > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 > |
From: Andy G. <an...@mi...> - 2005-01-05 21:47:33
|
HKLM\Software\Microsoft\Windows NT\CurrentVersion\AeDebug\UserDebuggerHotKey This contains the virtual keycode for the key (0 default, F12) - 0xff should disable the key. I believe you have to reboot before this takes effect. Andy. -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Mat Noguchi (BUNGIE) Sent: Wednesday, January 05, 2005 10:03 AM To: gam...@li... Subject: RE: [GD-Windows] Press F12 to crash... http://support.microsoft.com/support/kb/articles/q130/6/67.asp This is intentional. It does not happen if the application is not being debugged. MSN -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Richard Fabian Sent: Wednesday, January 05, 2005 9:20 AM To: gamedevwindows Subject: [GD-Windows] Press F12 to crash... Have just been informed by my mates that f12 crashes our game... i was a bit worried.. so I went on a hunt.. eventually found that the crash could be hit even before our game came up, so, me being who i am, booted up the hello world wizard in VC6, and compiled it... and ran the exe... pressed F12... and boom. As you can imagine, i was puzzled by this behaviour... especially as some of us use .NET and some use VC6 (like myself), and we tried to attribute this problem to directinput until i pointed out that the hello world app doesn;t use DirectX... Anyone come across anything similar? the only thing we all seem to have in common is that we are running XP sp2... I am even running a different Platform SDK from them. very odd. yours befuddledly: fabs(); ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Mat N. \(BUNGIE\) <mat...@mi...> - 2005-01-05 18:02:05
|
http://support.microsoft.com/support/kb/articles/q130/6/67.asp This is intentional. It does not happen if the application is not being debugged. MSN -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Richard Fabian Sent: Wednesday, January 05, 2005 9:20 AM To: gamedevwindows Subject: [GD-Windows] Press F12 to crash... Have just been informed by my mates that f12 crashes our game... i was a bit worried.. so I went on a hunt.. eventually found that the crash could be hit even before our game came up, so, me being who i am, booted up the hello world wizard in VC6, and compiled it... and ran the exe... pressed F12... and boom. As you can imagine, i was puzzled by this behaviour... especially as some of us use .NET and some use VC6 (like myself), and we tried to attribute this problem to directinput until i pointed out that the hello world app doesn;t use DirectX... Anyone come across anything similar? the only thing we all seem to have in common is that we are running XP sp2... I am even running a different Platform SDK from them. very odd. yours befuddledly: fabs(); ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |
From: Timur D. <ti...@cr...> - 2005-01-05 17:58:02
|
F12 is a well hidden very usefull feature of the MSVC,=20 When you press F12 during debugging, it is generating hardware breakpoint, (which looks very similar to the crash). So I suppose this is what you are getting. Do a search on F12 in msdn you`ll find out all about that. =20Cheers _____________________ Timur Davidenko Crytek (www.crytek.com) -----Original Message----- From: Richard Fabian [mailto:ra...@gm...]=20 Sent: Wednesday, January 05, 2005 6:20 PM To: gamedevwindows Subject: [GD-Windows] Press F12 to crash... [bcc] Importance: Low Have just been informed by my mates that f12 crashes our game... i was a bit worried.. so I went on a hunt.. eventually found that the crash could be hit even before our game came up, so, me being who i am, booted up the hello world wizard in VC6, and compiled it... and ran the exe... pressed F12... and boom. As you can imagine, i was puzzled by this behaviour... especially as some of us use .NET and some use VC6 (like myself), and we tried to attribute this problem to directinput until i pointed out that the hello world app doesn;t use DirectX... Anyone come across anything similar? the only thing we all seem to have in common is that we are running XP sp2... I am even running a different Platform SDK from them. very odd. yours befuddledly: fabs(); ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 ____ This message contains confidential information and is intended only for the = individual named. If you are not the named addressee you should not dissemin= ate, distribute or copy this e-mail. Please notify the sender immediately by= e-mail if you have received this e-mail by mistake and delete this e-mail f= rom your system. E-mail transmission cannot be guaranteed to be secure or er= ror-free as information could be intercepted, corrupted, lost, destroyed, ar= rive late or incomplete, or contain viruses. The sender therefore does not a= ccept liability for any errors or omissions in the contents of this message,= which arise as a result of e-mail transmission. If verification is required= please request a hard-copy version. Crytek GmbH - http://www.crytek.com |
From: Richard F. <ra...@gm...> - 2005-01-05 17:20:13
|
Have just been informed by my mates that f12 crashes our game... i was a bit worried.. so I went on a hunt.. eventually found that the crash could be hit even before our game came up, so, me being who i am, booted up the hello world wizard in VC6, and compiled it... and ran the exe... pressed F12... and boom. As you can imagine, i was puzzled by this behaviour... especially as some of us use .NET and some use VC6 (like myself), and we tried to attribute this problem to directinput until i pointed out that the hello world app doesn;t use DirectX... Anyone come across anything similar? the only thing we all seem to have in common is that we are running XP sp2... I am even running a different Platform SDK from them. very odd. yours befuddledly: fabs(); |
From: Ivan-Assen I. <iva...@gm...> - 2004-12-23 11:30:35
|
> Btw the solution need not to not connect > to the internet and not open the dialup > dialogbox ... It must stay completely passive, > just a "simple" Yes/No answer ... This is what I found in our codebase: BOOL IsThereAnInternetConnection() { //may not work if you are on a LAN but you're connected through a modem DWORD dwFlags; BOOL bResult = InternetGetConnectedState(&dwFlags, 0); return !!bResult; } |
From: Fabien <ge...@fr...> - 2004-12-23 06:38:00
|
Thanks a lot for these quick answer .... But what i am really searching is for an appropriate C/C++ solution for that ... I might f course execute the ping but in the particular case of my application it is not possible ... Btw the solution need not to not connect to the internet and not open the dialup dialogbox ... It must stay completely passive, just a "simple" Yes/No answer ... Thanks, Fabien H. |
From: Mick W. <de...@mi...> - 2004-12-23 00:00:00
|
Or getting even simpler, (but maybe inappropriate): from the command line: ping -n 1 w3.org | find "Received" /C returns 0 or 1 At 03:44 PM 12/22/2004, Mike Wuetherick wrote: >download a small/tiny file from a specific website that you know is there > >if it works, you have an internet connection ;} > >mike w >www.gekidodesigns.com > >Fabien wrote: >>Hello, >> >>I am actually trying to find a simple but reliable solution >>to detect if an internet connection is alive on Win32 OSes >>beginning with Win95 ? >> >>Thanks! >> >>Fabien H. > |
From: Mike W. <mi...@ge...> - 2004-12-22 23:44:14
|
download a small/tiny file from a specific website that you know is there if it works, you have an internet connection ;} mike w www.gekidodesigns.com Fabien wrote: > Hello, > > I am actually trying to find a simple but reliable solution > to detect if an internet connection is alive on Win32 OSes > beginning with Win95 ? > > Thanks! > > Fabien H. |
From: Fabien <ge...@fr...> - 2004-12-22 21:01:24
|
Hello, I am actually trying to find a simple but reliable solution to detect if an internet connection is alive on Win32 OSes beginning with Win95 ? Thanks! Fabien H. |
From: Ivan-Assen I. <as...@ha...> - 2004-12-21 11:06:31
|
> Is there any way to support variadic macros in Visual Studio like gcc > supports? If not, how do people write stuff like custom > asserts that take variable parameters? If the variable parameters are ultimately destined to go into a printf-like function (which I guess is the common case), we do the following: PRINT(dbg_category)("%d %d", something, something) dbg_category is on object of a class use to categorize debug printout messages, e.g. to filter them, to disable them selectively etc. This expands to something like that: dbgCategory.Enabled() ? 0 : GlobalSetFileLine(__FILE__, __LINE__) ? 0 : dbgCategory.Print Where the Print method of the debug categories is variadic and transfers its va_arg to a real sprintf. |
From: Paul B. <pa...@wi...> - 2004-12-21 10:40:11
|
> -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of Brett Bibby > Sent: Tuesday, December 21, 2004 2:42 AM > To: gam...@li... > Subject: Re: [GD-Windows] variadic macros >=20 > > Paul Bleisch wrote: > > Depending on what you're after, you might find that the __noop=20 > > intrinsic will help you out. > > >=20 > That's new, thanks. I don't think I can use it still though=20 > as I need to insert some parameters before calling the debug function. >=20 > This is what we have on other platforms: >=20 > #define MPE_SHELL_ERROR_LOG(...) \ > MpiShellLogTextAdd(__FILE__, \ > (MpeChar *)__func__, \ > __LINE__, \ > MPE_SHELL_LOG_FLAG_ERROR, \ > __VA_ARGS__) >=20 >=20 > I want to insert the file, func and line number. (BTW, does=20 > windows allow __func__ ?) >=20 > Thanks again, > Brett __func__ is not, but __FUNCTION__ is available (which I think is equivalent). A potential workaround for your varargs macros is to do something like: #ifdef _DEBUG void _SetDebugInfo(MpeChar* file, MpeChar* func, int line, unsigned flags); void _DebugPrint(char* fmt, ...); #define MPE_SHELL_ERROR_LOG _SetDebugInfo(__FILE__, __FUNCTION__, __LINE__, MPE_SHELL_LOG_FLAG_ERROR), _DebugPrint #else #define MPE_SHELL_ERROR_LOG __noop #endif this is not threadsafe and not a 1:1 replacement for your current code, so beware. Paul |
From: Brett B. <res...@ga...> - 2004-12-21 10:26:41
|
> Paul Bleisch wrote: > Depending on what you're after, you might find that the __noop > intrinsic will help you out. > That's new, thanks. I don't think I can use it still though as I need to insert some parameters before calling the debug function. This is what we have on other platforms: #define MPE_SHELL_ERROR_LOG(...) \ MpiShellLogTextAdd(__FILE__, \ (MpeChar *)__func__, \ __LINE__, \ MPE_SHELL_LOG_FLAG_ERROR, \ __VA_ARGS__) I want to insert the file, func and line number. (BTW, does windows allow __func__ ?) Thanks again, Brett |
From: Paul B. <pa...@wi...> - 2004-12-21 09:47:19
|
> -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of Brett Bibby > Sent: Tuesday, December 21, 2004 1:55 AM > To: Gam...@li... > Subject: [GD-Windows] variadic macros >=20 > Is there any way to support variadic macros in Visual Studio=20 > like gcc supports? If not, how do people write stuff like=20 > custom asserts that take variable parameters? >=20 > http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html >=20 > Thanks! > Brett Depending on what you're after, you might find that the __noop intrinsic will help you out. #ifdef _DEBUG void _MyDebugPrintf(const char* fmt, ...); #define DPF _MyDebugPrintf #else #define DPF __noop #endif // later, ... DPF("%s %s this works", FuncA(), FuncB()); FuncA and FuncB (or parameters in general) are not evaluated in non _DEBUG builds. The compiler ignores the statement. This is obviously not variadic macros, but you can do quite a bit with it. Paul |
From: Brett B. <res...@ga...> - 2004-12-21 09:39:45
|
Is there any way to support variadic macros in Visual Studio like gcc supports? If not, how do people write stuff like custom asserts that take variable parameters? http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html Thanks! Brett |
From: Daniel G. <dgl...@cr...> - 2004-12-09 22:57:52
|
Javier Arevalo wrote: > Also my understanding is that sizeof(*p) = (char*)(p+1) - (char*)(p) > by definition, so a class with an int is sizeof 4 and a class with an > int and an alignment of 16 must be sizeof 16. > > Save typos, that should give an idea of what's going on. Well then in the typedef __declspec(align(16)) Fred AlignedFred, VC 7.1 is broken. It passes through a size of 40 bytes for a new AlignedFred[10]. Contrast with class __declspec(align(16)) AlignedFred, new AlignedFred[10] passes in a size of 160 bytes. Last time I looked at the implementation for operator new in the CRT it called malloc. I don't see how the declspec is being honoured in such a case. cheers DanG -- Dan Glastonbury, Senior Programmer, The Creative Assembly PO Box 883 Fortitude Valley, QLD, Australia. 4006 T: +617 3252 1359 W: http://www.creative-assembly.com.au `Pour encourjay lays ortras' |
From: Javier A. <ja...@py...> - 2004-12-09 15:24:14
|
The compiler should call operator new with an adjusted size to cope with both the size of the objects and the padding needed to guarantee alignment, and then perform alignment of the pointer. Off the top of my head, something like this: EffectiveSize = (DataSize + Alignment -1) & ~(Alignment-1) SizeNeeded = EffectiveSize * ArraySize AlignedSizeNeed = SizeNeeded + (Alignment-1) Pointer = new(AlignedSizeNeeded) AlignedPointer = (Pointer + Alignment-1) & ~(Alignment-1) Call the constructor for AlignedPointer and afterwards in EffectiveSize increments I'm betting the compiler calculates the correct numbers, and inserts the final alignment code after the call to operator new. The call to delete[] will need the original Pointer value, so I would imagine the physical pointer to an aligned type is either bigger (to hold both the returned Pointer and the usable AlignedPointer), or the compiler keeps Pointer but does the conversion every time it is used. Also my understanding is that sizeof(*p) = (char*)(p+1) - (char*)(p) by definition, so a class with an int is sizeof 4 and a class with an int and an alignment of 16 must be sizeof 16. Save typos, that should give an idea of what's going on. -- Javier Arevalo Pyro Studios ----- Original Message ----- From: Daniel Glastonbury int s1 = sizeof(Fred); int s2 = sizeof(FredX); s1 is 4, s2 is 16 His explanation was to do with operator new[] failing if it didn't adjust the size. But my question is then, how does operator new cope with the typedef version? Incorrectly? |
From: Jon W. <hp...@mi...> - 2004-12-02 02:07:41
|
> It seems weird that aliasing would be a problem - since everything is in > 4 bytes chunks. From what I understood about aliasing, that only > mattered if you broke dword alignment, e.g. That's CPU register and memory aliasing, which is not the kind of aliasing I'm talking about. In compilers, any access through a pointer might conceivably change the value of the pointer itself (for example), so each time the pointer is accessed, it has to be re-loaded. There are type-based proofs the compiler can execute to not have to do this all the time, but most compilers are quite conservative. A simple disassembly of the two cases should tell you whether this is the case. Cheers, / h+ |
From: Daniel G. <dgl...@cr...> - 2004-12-02 01:40:12
|
Daniel Glastonbury wrote: > Andras Balogh wrote: > >> Let Fred be: >> >> class Fred { >> public: >> int helloiamfred; >> }; >> >> then sizeof(Fred) will be 4 >> >> but if I align the same class to 16 bytes: >> >> class __declspec(align(16)) Fred { >> public: >> int helloiamfred; >> }; >> >> then sizeof(Fred) will be 16!!! >> >> > No it won't. I've just been told by a friend that VS.Net spits out the following: * class Fred* *{* *public:* *int helloiamfred;* *};* *class __declspec(align(16)) FredX {* *public:* *int helloiamfred;* *};* *int s1 = sizeof(Fred);* *int s2 = sizeof(FredX);* *s1 is 4, s2 is 16 * His explanation was to do with operator new[] failing if it didn't adjust the size. But my question is then, how does operator new cope with the typedef version? Incorrectly? cheers DanG -- Dan Glastonbury, Senior Programmer, The Creative Assembly PO Box 883 Fortitude Valley, QLD, Australia. 4006 T: +617 3252 1359 W: http://www.creative-assembly.com.au `Pour encourjay lays ortras' |
From: Daniel G. <dgl...@cr...> - 2004-12-02 01:10:20
|
Andras Balogh wrote: >I measured the time of computing 100 million bilinear interpolation using >dot products, and changing the dprod operation to accept a const reference >instead of the const value makes the test run an order of magnitude slower!! > Did you look at the disassembly for each function? cheers DanG -- Dan Glastonbury, Senior Programmer, The Creative Assembly PO Box 883 Fortitude Valley, QLD, Australia. 4006 T: +617 3252 1359 W: http://www.creative-assembly.com.au `Pour encourjay lays ortras' |
From: Daniel G. <dgl...@cr...> - 2004-12-02 01:10:18
|
Andras Balogh wrote: >Let Fred be: > >class Fred { >public: > int helloiamfred; >}; > >then sizeof(Fred) will be 4 > >but if I align the same class to 16 bytes: > >class __declspec(align(16)) Fred { >public: > int helloiamfred; >}; > >then sizeof(Fred) will be 16!!! > > No it won't. As others on the list have already said, in both cases sizeof(Fred) will be 4 bytes. It's still in int! In the case of the aligned Fred, the alignment constraint means the compiler will allocate the object on a 16 byte boundary[1]. If you create an array of Freds, then the compiler will allocate the first Fred on the boundary and then add 12 bytes of padding, before the next Fred. This is the same as: struct s { unsigned char c; int i; } The language rules say that s.i needs to be aligned on a 4 byte boundary, so the compiler will add 3 bytes of padding between s.c and s.i. (This can be overriden by the #pragma (pack) directive.) >The reason is that if you want an array of Freds, each have to be aligned, >so it's not just the base address, that's changed, but the padding too! > > Exactly. The padding has changed. Not the size of Fred. Hope this helps to clear things up. cheers DanG [1] Of course heap allocated objects won't adhere to the constraint, unless you use the aligned version of malloc. -- Dan Glastonbury, Senior Programmer, The Creative Assembly PO Box 883 Fortitude Valley, QLD, Australia. 4006 T: +617 3252 1359 W: http://www.creative-assembly.com.au `Pour encourjay lays ortras' |