diff options
author | David Robillard <d@drobilla.net> | 2019-07-22 12:48:25 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-29 01:59:11 +0200 |
commit | 982ea3f09aa968bd89b00f445272984cb629b346 (patch) | |
tree | eb36abf0c2db8585d84badf8773dcc0b97060245 | |
parent | e23890324d169d03868855a3e265ab4e3cd43745 (diff) | |
download | pugl-982ea3f09aa968bd89b00f445272984cb629b346.tar.gz pugl-982ea3f09aa968bd89b00f445272984cb629b346.tar.bz2 pugl-982ea3f09aa968bd89b00f445272984cb629b346.zip |
Add deprecation macro and deprecate puglInitResizable()
-rw-r--r-- | Doxyfile.in | 2 | ||||
-rw-r--r-- | pugl/pugl.h | 12 | ||||
-rw-r--r-- | test/pugl_cairo_test.c | 2 | ||||
-rw-r--r-- | test/pugl_test.c | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/Doxyfile.in b/Doxyfile.in index eda89a1..7568692 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -2027,7 +2027,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = PUGL_API +PREDEFINED = PUGL_API PUGL_DEPRECATED_BY # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/pugl/pugl.h b/pugl/pugl.h index adeeb0e..1567b1f 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -41,6 +41,14 @@ # define PUGL_API #endif +#if defined(__clang__) +# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("", name))) +#elif defined(__GNUC__) +# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("Use " name))) +#else +# define PUGL_DEPRECATED_BY(name) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -474,8 +482,10 @@ puglInitWindowAspectRatio(PuglView* view, /** Enable or disable resizing before creating a window. + + @deprecated Use puglInitWindowHint() with @ref PUGL_RESIZABLE. */ -PUGL_API void +PUGL_API PUGL_DEPRECATED_BY("puglInitWindowHint") void puglInitResizable(PuglView* view, bool resizable); /** diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c index d749485..ba1dad3 100644 --- a/test/pugl_cairo_test.c +++ b/test/pugl_cairo_test.c @@ -184,7 +184,7 @@ main(int argc, char** argv) puglInitWindowClass(view, "PuglCairoTest"); puglInitWindowSize(view, 512, 512); puglInitWindowMinSize(view, 256, 256); - puglInitResizable(view, resizable); + puglInitWindowHint(view, PUGL_RESIZABLE, resizable); puglInitContextType(view, PUGL_CAIRO); puglIgnoreKeyRepeat(view, ignoreKeyRepeat); diff --git a/test/pugl_test.c b/test/pugl_test.c index fe1cc29..dfc06c6 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -171,8 +171,8 @@ main(int argc, char** argv) puglInitWindowSize(view, 512, 512); puglInitWindowMinSize(view, 256, 256); puglInitWindowAspectRatio(view, 1, 1, 16, 9); - puglInitResizable(view, resizable); + puglInitWindowHint(view, PUGL_RESIZABLE, resizable); puglInitWindowHint(view, PUGL_SAMPLES, samples); puglInitWindowHint(view, PUGL_DOUBLE_BUFFER, doubleBuffer); |