Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop Rust from prepending underscore before '?' for win32 #822

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

upsuper
Copy link
Contributor

@upsuper upsuper commented Jul 18, 2017

This fixes #819.

It also includes tests for different platforms which are not supposed to be affected, so that we won't regress them in the future either.

The prefix \x01 char is necessary for Win32. See also msvc32_symbolify function in regen_atoms.py.

@upsuper
Copy link
Contributor Author

upsuper commented Jul 18, 2017

r? @emilio

match symbol.chars().next().unwrap() {
// Stripping leading underscore for all names on Darwin and
// C linkage functions on Win32.
'_' => { symbol.remove(0); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: No need for braces, here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it needs. String::remove returns char and String::insert returns nothing.

@upsuper
Copy link
Contributor Author

upsuper commented Jul 18, 2017

@bors-servo r=emilio

@bors-servo
Copy link

📌 Commit 4f8de62 has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 4f8de62 with merge 63de24e...

bors-servo pushed a commit that referenced this pull request Jul 18, 2017
Stop Rust from prepending underscore before '?' for win32

This fixes #819.

It also includes tests for different platforms which are not supposed to be affected, so that we won't regress them in the future either.

The prefix `\x01` char is necessary for Win32. See also [msvc32_symbolify function in regen_atoms.py](https://github.com/servo/servo/blob/1b6d29e31996c87218352b825aa93e01909a6a24/components/style/gecko/regen_atoms.py#L35-L38).
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 63de24e to master...

@bors-servo bors-servo merged commit 4f8de62 into rust-lang:master Jul 18, 2017
@upsuper upsuper deleted the mangling-fix branch July 18, 2017 08:49
@Manishearth Manishearth mentioned this pull request Jul 21, 2017
bors-servo pushed a commit that referenced this pull request Jul 24, 2017
Bump to 0.28

Brings in  #822 which unblocks https://bugzilla.mozilla.org/show_bug.cgi?id=1366956,
and also #829 which should greatly reduce merge conflicts in checked in bindings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mangling hack doesn't work well with variable symbols
4 participants