Eg. In file guard is for each function:
So, I see 2 cases for the code you sent:

1) In user code, they can just #include <intrin.h>. There are no special defines they need to create. By default, it will create inline definitions for all intrinsics.

2) In files like intrinsic\__stosb.c, the code would look something like this:

#define IMPLEMENT_FUNCTION
#define SPECIAL_FUNCTION___stosb
#include <intrin.h>

But you must be thinking of a third case? Otherwise this seems too complex. Why not something like:

#if (!defined (__INTRINSIC_ONLYSPECIAL)) || (defined (__INTRINSIC_ONLYSPECIAL) && defined(__INTRINSIC_SPECIAL_<NAME>))

#ifndef __INTRINSIC_ONLYSPECIAL
__CRT_INLINE
#endif
<implementation ....>
#endif

FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) {
This is the first time I've ever actually seen an extern "C++". I'm not surprised there is such a thing, I've just never seen it used before.

Still, I have no problem with this. Since these are declared as C++, their names get mangled and there is no conflict.

I'm wondering about the problem we are having with __stosb. After poking around some more, I wonder if this is due to cygwin defining size_t wrong. It's hard for me to say for sure since I haven't been able to exactly reproduce alexey's problem. But under Windows, SIZE_T and size_t are both unsigned __int64. And it appears possible that under certain circumstance cygwin will define size_t as long unsigned int (check out __SIZE_TYPE__ in alexey's output <http://pastebin.com/PaBMjAtr>). If you are building for Windows, that seems wrong.

dw

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to