Skip to content

std.stdio: improve standardization of C I/O functions across runtimes#1093

Closed
kinke wants to merge 2 commits intodlang:masterfrom
kinke:dmd-master
Closed

std.stdio: improve standardization of C I/O functions across runtimes#1093
kinke wants to merge 2 commits intodlang:masterfrom
kinke:dmd-master

Conversation

@kinke
Copy link
Contributor

@kinke kinke commented Jan 23, 2013

Standardize the primary C I/O functions into a common (GCC) interface:

  • fgetc_unlocked, fgetwc_unlocked
  • fputc_unlocked, fputwc_unlocked
  • flockfile, funlockfile

On OSX/FreeBSD, use provided fgetc_unlocked/fputc_unlocked functions instead of using the locked versions internally (may increase performance for narrow streams).

@alexrp
Copy link
Contributor

alexrp commented Jan 23, 2013

Fails on Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This cast from dchar to wchar is necessary as I fixed the fputwc* function declarations to take wchar_t (wchar on Windows, else dchar) characters instead of int. Not sure about the DMC runtime, so I left it alone (taking an int character).

@alexrp
Copy link
Contributor

alexrp commented Jan 23, 2013

Please squash all those "fix" commits together to keep the history clean.

std/stdio.d Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, this isn't universally true for LDC – on 32 bit Windows, our best bet right now is MinGW (working exception support).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay thx, I've removed the LDC specifics.

@ghost
Copy link

ghost commented Oct 25, 2013

What ever happened to this? It seems its trivial enough that it should have been pulled.

@DmitryOlshansky
Copy link
Member

Concur with @AndrejMitrovic what's the holdback? In any case there are 2 paths: rebase or death ;)

@ghost
Copy link

ghost commented Feb 15, 2014

Rebased here: #1942

This pull request was closed.
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.

5 participants