473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Coping with underscore decoration conventions

A good day to you all,

I had an old code project lying around, written in C + assembly and
targeted for X86 Linux, that I intended to compile on Win32 as well.
I'm using GCC and NASM on Linux (not really sure which version but
nothing too esoteric), and MingW and NASM on Windows. I quickly ran
into the problem of differing calling conventions between Linux and
Windows: my assembly code exports several symbols, but the MingW GCC
won't link to them unless I prepend a _ to the symbol names, whereas
GCC on Linux seems not to care about this. I guess I can add an
underscore to the required variable names, but I intended to retain
code portability - is there a way around this?
Thanks in advance.

Nov 15 '05 #1
2 1761
In article <11*********************@g43g2000cwa.googlegroups. com>,
AntiPasta <an*******@gmail.com> wrote:
A good day to you all,

I had an old code project lying around, written in C + assembly and
targeted for X86 Linux, that I intended to compile on Win32 as well.
I'm using GCC and NASM on Linux (not really sure which version but
nothing too esoteric), and MingW and NASM on Windows. I quickly ran
into the problem of differing calling conventions between Linux and
Windows: my assembly code exports several symbols, but the MingW GCC
won't link to them unless I prepend a _ to the symbol names, whereas
GCC on Linux seems not to care about this. I guess I can add an
underscore to the required variable names, but I intended to retain
code portability - is there a way around this?
Thanks in advance.


<OT>
The usual method is to define macros that are turned on in the Winders
compiles.
</OT>

Nov 15 '05 #2
>
<OT>
The usual method is to define macros that are turned on in the Winders
compiles.
</OT>


Well, actually, I'd need to define macros in NASM to do this, but that
is probably impossible in this case. I was looking for a way to get
MingW to "forget" the underscores.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Andrew Tang | last post by:
Hi, I need some help with understanding this piece of css. <u>This is a <a href="#" style="text-decoration:none;">hyperlink</a> with surrounding underlining</u> From what I understand of css,...
3
by: Christian Roth | last post by:
What I want: <p style="text-decoration: line-through"> Stricken <span style="text-decoration: none">not stricken</span> </p> , where "Stricken " should be the only thing that is lined...
5
by: Walter Tross | last post by:
Somebody with a very regulatory mind in this newsgroup has written that it's better not to use a leading underscore for class member names, because names with a leading underscore are used...
2
by: jess | last post by:
Hi, Im using the following code to make a new report based on an existing report. Set rpt = CreateReport(, "_SemiAnnualMaster") The problem that I am running into is that none of the report...
4
by: mike parr | last post by:
A few times when looking at code on the net I have seen objects, variables etc prefixed by an underscore. But I've never seen any explanation for the reason for this. What is the reason for doing...
13
by: PromisedOyster | last post by:
Many in our development team have came from a C++ background and are in the practice of prefixing private class variables with an underscore to improve readability and avoid naming collisions with...
2
by: scott | last post by:
Is there a way to make the underscore Character display in a browser? I've tried several different fonts but the "_" character will not display.
2
by: Francesco Moi | last post by:
Hi. I want to create a link within a H1 text: --- <h1><a href=foo>text</a></h1> --- And I've got (in my CSS) --- h1
2
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.