Skip to content

Fails to build with sdl2-compat #393

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

Closed
v1993 opened this issue Jan 28, 2025 · 2 comments
Closed

Fails to build with sdl2-compat #393

v1993 opened this issue Jan 28, 2025 · 2 comments

Comments

@v1993
Copy link

v1993 commented Jan 28, 2025

I'm getting implicit declaration errors after updating from SDL2 to SDL3 + sdl2-compat, e.g.

share/audio.c: In functionvoice_step’:
share/audio.c:65:32: error: implicit declaration of functionpow’ [-Wimplicit-function-declaration]
   65 | #define LOG_VOLUME(v) ((float) pow((double) (v), 2.0))
      |                                ^~~
share/audio.c:105:40: note: in expansion of macroLOG_VOLUME105 |                     short M = (short) (LOG_VOLUME(V->amp) * volume * buffer[i]);
      |                                        ^~~~~~~~~~
share/audio.c:30:1: note: include<math.h>or provide a declaration ofpow29 | #include "log.h"
  +++ |+#include <math.h>
   30 | 
share/glext.c: In functionglext_init’:
share/glext.c:131:5: error: implicit declaration of functionmemset’ [-Wimplicit-function-declaration]
  131 |     memset(&gli, 0, sizeof (struct gl_info));
      |     ^~~~~~
share/glext.c:20:1: note: include<string.h>or provide a declaration ofmemset19 | #include "log.h"
  +++ |+#include <string.h>
   20 | 
share/glext.c:131:5: warning: incompatible implicit declaration of built-in functionmemset’ [-Wbuiltin-declaration-mismatch]
  131 |     memset(&gli, 0, sizeof (struct gl_info));
      |     ^~~~~~
share/glext.c:131:5: note: include<string.h>or provide a declaration ofmemsetshare/glext.c:106:5: error: implicit declaration of functionmemcpy’ [-Wimplicit-function-declaration]
  106 |     memcpy(&fun, &ptr, sizeof (void *));                 \
      |     ^~~~~~
@parasti
Copy link
Member

parasti commented Jan 29, 2025

Compiler version?

@parasti
Copy link
Member

parasti commented Jan 29, 2025

Actually I guess it's just that we missed some includes and SDL used to include them incidentally but no longer does. I'll commit a fix later.

@parasti parasti closed this as completed in 6de282e Feb 4, 2025
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

No branches or pull requests

2 participants