Just a few last things I need to get straight.
So if you use pragma intrinisic then the compiler doesn't need the header file for that function. It is taken as a keyword and translated into direct asm.
For example on msnd site _outp requires <conio.h> if I use the pragma do I not have to include the <conio.h> because I don't want to include any header files except mine. I don't want to depend on their libraries.
Here is the link on what I am talking about.
They say required header file conio.h

http://msdn.microsoft.com/en-us/library ... S.80).aspx
Ahhh , The alignment thing I get it. It's if you want to effect the whole project or just piece's. Although the #pragma pack could be used to effect the whole project just depends where you close it with a pop..etc
I see where it reduces execution time it is just replacing the function with the exact asm equivalent.
So if I had all my files named .c in my project would something my wrong if I compiled it with the default which is C++.Don't know the answer to that, I compile my kernel code as C++ (but actually use only the function overloading feature of C++).
I guess I can change the extensions to all my files to cpp.
But I am wondering if I can take my old c libraries and create a project in visual studio's 2005 keep them .c files with out any trouble.
Or must you use extern "C" each time you have a c file.
I am just confused how c files are compiled in VS 2005 because their is no extension when creating a file you can only select create cpp file not c file.
However they allow for extension's *.c ...etc
Just wondering if anybody out their knows what's up with this never had an issues in dev c++.
/TD ?
Their is no outportword in VS 2005 the equivalent is this so I guess I would have this
Code: Select all
extern "C" {
void outp(uint port, uint8 value);
void outpw(...); // etc
}
#pragma intrinsic(outp, ...)
#define IoPortWriteByte(port, value) outp(port, value)
..etc etc