From 416478739315ca41ad236197b25f87b83ab7f312 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Jan 2021 21:40:40 +0100 Subject: Add PUGL_CONST_API Just a convenience macro to make declarations a little more readable. --- include/pugl/cairo.h | 3 +-- include/pugl/gl.h | 3 +-- include/pugl/pugl.h | 7 +++++-- include/pugl/stub.h | 3 +-- include/pugl/vulkan.h | 3 +-- 5 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include/pugl') diff --git a/include/pugl/cairo.h b/include/pugl/cairo.h index 9909682..48e868e 100644 --- a/include/pugl/cairo.h +++ b/include/pugl/cairo.h @@ -33,8 +33,7 @@ PUGL_BEGIN_DECLS Pass the returned value to puglSetBackend() to draw to a view with Cairo. */ -PUGL_API -PUGL_CONST_FUNC +PUGL_CONST_API const PuglBackend* puglCairoBackend(void); diff --git a/include/pugl/gl.h b/include/pugl/gl.h index 3443d83..51c4a7d 100644 --- a/include/pugl/gl.h +++ b/include/pugl/gl.h @@ -94,8 +94,7 @@ puglLeaveContext(PuglView* view); Pass the returned value to puglSetBackend() to draw to a view with OpenGL. */ -PUGL_API -PUGL_CONST_FUNC +PUGL_CONST_API const PuglBackend* puglGlBackend(void); diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 7cb7bc2..41afc25 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -47,6 +47,10 @@ # define PUGL_CONST_FUNC #endif +#define PUGL_CONST_API \ + PUGL_API \ + PUGL_CONST_FUNC + #ifdef __cplusplus # define PUGL_BEGIN_DECLS extern "C" { # define PUGL_END_DECLS } @@ -585,8 +589,7 @@ typedef enum { } PuglStatus; /// Return a string describing a status code -PUGL_API -PUGL_CONST_FUNC +PUGL_CONST_API const char* puglStrerror(PuglStatus status); diff --git a/include/pugl/stub.h b/include/pugl/stub.h index 46e0e96..d1a699a 100644 --- a/include/pugl/stub.h +++ b/include/pugl/stub.h @@ -34,8 +34,7 @@ PUGL_BEGIN_DECLS This backend just creates a simple native window without setting up any portable graphics API. */ -PUGL_API -PUGL_CONST_FUNC +PUGL_CONST_API const PuglBackend* puglStubBackend(void); diff --git a/include/pugl/vulkan.h b/include/pugl/vulkan.h index 8941510..f12ad97 100644 --- a/include/pugl/vulkan.h +++ b/include/pugl/vulkan.h @@ -143,8 +143,7 @@ puglCreateSurface(PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr, Pass the returned value to puglSetBackend() to draw to a view with Vulkan. */ -PUGL_API -PUGL_CONST_FUNC +PUGL_CONST_API const PuglBackend* puglVulkanBackend(void); -- cgit v1.2.1