Do you know of any that can do this :


You might be able to do this via D's Tuples and/or Template Mixins.
Posted on 2010-08-17 12:50:25 by SpooK
Yes yes D 2.0 looks like it!

Compile time function execution, and pragma msg with printf like syntax. That's it!!

lots of features!
not to mention inline asm, native and managed,  oop and procedural - great.
also looks like it doesn't use the annoying alllower_or_with___underscore naming


2.0 in development,- downloading it anyway.

thanks for the hint!
Posted on 2010-08-17 14:31:23 by drizz
okay well from what I have gathered and from what was said here, the code will work should I not use any includes directly assosciated with linux.
Thanks  :D
Posted on 2010-08-17 14:42:22 by v0rtex
Drizz,

only for closing that question:

External asm module? What assemblers are there for MacOSX? Nasm, yes?


Okay, NASM is available for MacOS X. That could be one way, although the link process in C++ might be a bit awkward. The external "C" won't work for member functions. Name mangling and decoration isn't standardized between different compilers. A friend function should work. That's a bit tricky. With ANSI C there are no problems, of course.

Do you know of any that can do this


As I said: With macros you can do magic things. If you love that feature, please use it. But I've also seen good sources from experienced assembly language programmers, where macros are rare birds. That's another way and nothing is wrong with that.

Gunther


Posted on 2010-08-17 16:43:51 by Gunther
Don't try to define C++ member functions in external assembly modules - define them in C++ and have them call your assembly module functions.
Posted on 2010-08-17 16:49:48 by f0dder
Don't try to define C++ member functions in external assembly modules - define them in C++ and have them call your assembly module functions.


That seems to be a good advice. Do you have an example for that technique?

Gunther
Posted on 2010-08-17 18:23:12 by Gunther

Don't try to define C++ member functions in external assembly modules - define them in C++ and have them call your assembly module functions.

That seems to be a good advice. Do you have an example for that technique?

Gunther


I would imagine that you would do it the same way with C libraries, extern C within C++ and globals in your assembly object. Just adhere to the CDECL calling convention for your assembly exported/global functions and you are good to go.
Posted on 2010-08-17 18:27:40 by SpooK
although the link process in C++ might be a bit awkward. The external "C" won't work for member functions. Name mangling and decoration isn't standardized between different compilers. A friend function should work. That's a bit tricky. With ANSI C there are no problems, of course.
You write member functions in asm, you really are hardcore  :)

http://www.asmcommunity.net/board/index.php?topic=25265.msg184818#msg184818
Posted on 2010-08-17 22:02:21 by drizz
You write member functions in asm, you really are hardcore


Yes, sometimes. I like hardcore programming - AT&T syntax, member functions with an external assembler etc.  ;). Anyway, thank you for the link.

Gunther
Posted on 2010-08-18 07:09:10 by Gunther