Skip to content

Drop unnecessary stdint and inttypes header checks #5323

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

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Mar 29, 2020

As they are always available per C99.

Hopefully I didn't forget any checks and the script generating the libmagic.patch did it's job.

@nikic
Copy link
Member

nikic commented Mar 30, 2020

Before we do this, I'd like to get rid out our stdint.h / inttypes.h shims for Windows, so we really are using only system headers. @cmb69 Am I understanding right that we no longer need win32/php_stdint.h? It seems that our MSC_VER requirement on master is 1920, while this header is for < 1900.

@cmb69
Copy link
Member

cmb69 commented Mar 30, 2020

While it still should be possible to build master with VS 2017 and maybe VS 2015, there is certainly no need to support older VS versions, so win32/php_inttypes.h can be removed. Thanks.

@cmb69
Copy link
Member

cmb69 commented Apr 13, 2020

I think https://gist.github.com/cmb69/e517a72a5d86b9982e1a9ad3d10517f7 can be applied on top of this PR (note that I have ignored libmagic.patch). I'm not quite sure about the u_char typedefs; likely these can be removed as well, what would give more opportunities to refactor a bit more.

@Girgias Girgias force-pushed the drop-stdint-inttypes-header-checks branch from eab07c5 to e09021c Compare April 13, 2020 17:43
@cmb69
Copy link
Member

cmb69 commented Apr 14, 2020

https://gist.github.com/cmb69/553a44f5b3f6027fe9c5931cf2b845fe drops several superfluous u_char fallback definitions, but keeps one in php_stdint.h. Maybe we should actually remove the u_char definition in favor of standard types, like we did with uint and ulong in 7.4.

@Girgias Girgias force-pushed the drop-stdint-inttypes-header-checks branch from e09021c to 993ebae Compare April 15, 2020 00:39
@Girgias Girgias force-pushed the drop-stdint-inttypes-header-checks branch 3 times, most recently from 57da6b2 to d86c5de Compare April 22, 2020 15:08
@Girgias
Copy link
Member Author

Girgias commented Apr 22, 2020

@cmb69 can we also drop the "ifdef HAVE_INT8_T and co variants or are those still needed?

@cmb69
Copy link
Member

cmb69 commented Apr 22, 2020

can we also drop the "ifdef HAVE_INT8_T and co variants or are those still needed?

These are not needed for Windows (since the macro is no longer defined), but maybe for other systems?

@Girgias
Copy link
Member Author

Girgias commented Apr 22, 2020

can we also drop the "ifdef HAVE_INT8_T and co variants or are those still needed?

These are not needed for Windows (since the macro is no longer defined), but maybe for other systems?

I'm trying to read up on it, but it seems Autoconf takes care of defining (at least some of them) when they are not available: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Particular-Types.html

These are always available as of C99.

Closes phpGH-5323

Co-authored-by: "Christoph M. Becker" <[email protected]>
@Girgias Girgias force-pushed the drop-stdint-inttypes-header-checks branch from d86c5de to f91f726 Compare April 22, 2020 18:18
@php-pulls php-pulls closed this in f91f726 Apr 22, 2020
@Girgias Girgias deleted the drop-stdint-inttypes-header-checks branch April 22, 2020 18:19
@php-pulls php-pulls merged commit f91f726 into php:master Apr 22, 2020
cmb69 added a commit to cmb69/pecl-memcache that referenced this pull request Jan 12, 2021
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.

4 participants