Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"10-07-10 - Portable CRT God Dammit"

3 Comments -

1 – 3 of 3
Blogger Jim Tilander said...

Just make your own wrappers, it's always going to pay off. MS just has a insane way of extending things their own way so that you have to bend over backwards to do anything on their platform. All the names are different and 64 bit is just an afterthought.

Doing printf formatting with pointers and 64 bit numbers across multiple platform is a *nightmare* ... yeah, they could have done this better...

October 8, 2010 at 8:20 PM

Anonymous Anonymous said...

I have some portability stuff in stb.h but I didn't bother breaking it out.

Because for me the other problem is that the C library has stupid crap like strncpy() which don't really do what you want, so I might as well put better wrappers on those too.

Oh, and hey, for portability I can add an fopen/fclose wrapper that does UTF8 on Windows. And as long as I'm at it, I'll make it write to a temporary file and then the fclose() moves it over the old one.

Oh and as long as I'm doing that, maybe I'll make a file compression thing so I can get 2:1 compression on anything I write if I really want.

And then it mushroomed out of control.

But maybe a just-portability-that's-it-nothing-else would be good.

October 9, 2010 at 1:36 AM

Blogger cbloom said...

Yeah, I have the same problem of adding too much of my own stuff, but then I can't use it in super-low-level applications. The money thing to do would be :

pcrt : just portable crt, no extensions

pcrtplus : add things like strlcpy , strnicmp, vsnwprintf that aren't quite crt but should be

pcrtthread : add portable threading stuff

pcrtpath : add utf8 file stuff and dir listing and such (not just stdio but rename/delete/truncate), cross platform path manipulation

what a mess

October 9, 2010 at 10:30 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.