Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
MT in MSVCRT

 
Post new topic   Reply to topic Printable version
 View previous topic  SSN Tank Warfare Post :: Post Help me Mr.Ekted  View next topic  
Author Message
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Aug 01, 2004 12:55 pm   Post maybe stupid    Post subject: MT in MSVCRT Reply to topic Reply with quote

Just curious about this. In MS' CRT code, they always put MT-safe code in a separate function, like this:
Code: Show/Hide
#ifdef _MT
/* define locking/unlocking version */
size_t __cdecl fwrite (
        const void *buffer,
        size_t size,
        size_t count,
        FILE *stream
        )
{
        size_t retval;

        _lock_str(stream);                      /* lock stream */
        retval = _fwrite_lk(buffer, size, count, stream);  /* do the read */
        _unlock_str(stream);                    /* unlock stream */
        return retval;
}
#endif  /* _MT */

/* define the normal version */
#ifdef _MT
size_t __cdecl _fwrite_lk (
#else  /* _MT */
size_t __cdecl fwrite (
#endif  /* _MT */
//blah blah blah


I'd just put something like:
Code: Show/Hide
#ifdef _MT
_lock_str(stream);
#endif
//etc


Is there actually a reason for the way MS does it, or are they just stupid?
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Aug 01, 2004 1:43 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

They are just stupid. Don't look too hard at the run-time source if you just ate.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Aug 01, 2004 1:53 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

OK, thank goodness I posted this right before lunch. icon_biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sun Aug 01, 2004 3:25 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

They REALLY try to keep all the code inside the same area, so their method of making it work with 50 different compiling options really screw around with readablity. It works, but it takes more time to figure out how it works than it would to simple remake the code in a nicer manner.
Back to top
View users profile Send private message Add User to Ignore List Send email
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 35 page(s) served in previous 5 minutes.

phpBB Created this page in 0.544940 seconds : 28 queries executed (91.9%): GZIP compression disabled