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

Fixed compilation for older C #915

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

arves100
Copy link
Contributor

@arves100 arves100 commented Jun 28, 2018

This commit fixes compilation of Allegro5 library for compilers that dosen't support C99 for Windows builds without any dependency.
Tested with Visual Sutdio 2008.

@@ -174,15 +174,18 @@ static void attach_depth_buffer(ALLEGRO_FBO_INFO *info)
ALLEGRO_DISPLAY *display = _al_get_bitmap_display(info->owner);
int w = al_get_bitmap_width(info->owner);
int h = al_get_bitmap_height(info->owner);
int samples = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there's some whitespace inconsistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the next commit. Thanks.

@@ -967,7 +968,9 @@ static bool create_display_internals(ALLEGRO_DISPLAY_WGL *wgl_disp)
if ((disp->flags & ALLEGRO_OPENGL_3_0) || major != 0) {
if (major == 0)
major = 3;
bool fc = (disp->flags & ALLEGRO_OPENGL_FORWARD_COMPATIBLE) != 0;
if ((disp->flags & ALLEGRO_OPENGL_FORWARD_COMPATIBLE) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

that != 0 there is a bit unnecessary if we are introducing a new if() statement here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, fixed in the next commit. Thanks.

@arves100
Copy link
Contributor Author

By now, allegro, color, dialog, font, image, memfile, primitives and ttf should compile.
Image without libwebp support.

@elias-pschernig
Copy link
Member

Just out of curiosity, why are using such an ancient compiler? In a way it would be nice to move forward and remove support for outdated compilers from Allegro over time (for example require stdint support) - so I'm a bit conflicted about all the changes now to support something so old.

@fatcerberus
Copy link
Contributor

I agree with Elias, VS2008 is 10 years old at this point. I thought our documentation already stated we required C99 support anyway?

@dos1
Copy link
Contributor

dos1 commented Jun 29, 2018

I think it may be because older Visual Studio use stdlib that's included in Windows, while newer ones need redistributables (I think). However, I'm also conflicted about such stuff, as it definitely doesn't make the code more legible. It may be nice to have such branch floating around somewhere for such strange use cases, but I'm not sure if it should be merged in after all.

@arves100
Copy link
Contributor Author

arves100 commented Jun 29, 2018

I haven't checked the documentation if it requires C99.
If so, I could keep this changes into my account in case someone needs it.
Unfortunaly it dosen't help the code begin more redible.
I still use vs2008 because it's the fastest in compilation and IDE usage (my pentium cpu doesn't like newer vs) in Windows.
While there are alternatives like CodeBlocks, I don't like none of the open ide, while Vscode it's slow and it's missing several features for C/C++ development.
Regarding stdint, Allegro already have astdint that defined the missing types (uint16_t,...), so I guess there's no problem.

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