-
Notifications
You must be signed in to change notification settings - Fork 288
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
base: master
Are you sure you want to change the base?
Conversation
src/opengl/ogl_fbo.c
Outdated
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/win/wgl_disp.c
Outdated
@@ -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) |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
By now, allegro, color, dialog, font, image, memfile, primitives and ttf should compile. |
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. |
I agree with Elias, VS2008 is 10 years old at this point. I thought our documentation already stated we required C99 support anyway? |
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. |
I haven't checked the documentation if it requires C99. |
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.