~lattis/muon#85: 
`__attribute__(format)` does not exist with msvc

msvc (compiler provided with Visual Studio) does not support __attribute__(format).

we can add something like

#if defined (__GNUC__)
#muon_format(_a, _b) __attribute__ ((format(printf, _a, _b)));
#else
#muon_format(_a, _b)
#endif

maybe it is time to add a config.h file or something similar ?

Status
RESOLVED IMPLEMENTED
Submitter
~vtorri
Assigned to
No-one
Submitted
1 year, 3 months ago
Updated
1 year, 3 months ago
Labels
No labels applied.

~vtorri 1 year, 3 months ago

after some discussion on IRC, a compat.h file containing

#if !defined(_POSIX_C_SOURCE) && !defined(_WIN32)
#define _POSIX_C_SOURCE 200809L
#endif

#ifndef MUON_FORMAT
#ifdef (__GNUC__)
#define MUON_FORMAT(_f1, _f2) __attribute__ ((format(printf, _f1, _f2)))
#else
#define MUON_FORMAT(_f1, _f2)
#endif
#endif

should be added. I would include it at the top of all source file.

~lattis REPORTED IMPLEMENTED 1 year, 3 months ago

This has been created

Register here or Log in to comment, or comment via email.