2828 */
2929#include <assert.h>
3030// only include these extra dependencies if support for PNG output was enabled
31- #ifdef SAXBOSPIRAL_PNG_SUPPORT
31+ #ifdef LIBSXBP_PNG_SUPPORT
3232#include <stdlib.h>
3333#include <string.h>
34- #endif
3534
36- // only include libpng if support for it was enabled
37- #ifdef SAXBOSPIRAL_PNG_SUPPORT
3835#include <png.h>
3936#endif
4037
@@ -48,7 +45,7 @@ extern "C"{
4845#endif
4946
5047// only define the following private functions if libpng support was enabled
51- #ifdef SAXBOSPIRAL_PNG_SUPPORT
48+ #ifdef LIBSXBP_PNG_SUPPORT
5249// private custom libPNG buffer write function
5350static void buffer_write_data (
5451 png_structp png_ptr , png_bytep data , png_size_t length
@@ -93,7 +90,14 @@ static void cleanup_png_lib(
9390 free (row );
9491 }
9592}
96- #endif // SAXBOSPIRAL_PNG_SUPPORT
93+ #endif // LIBSXBP_PNG_SUPPORT
94+
95+ // flag for whether PNG output support has been compiled in based, on macro
96+ #ifdef LIBSXBP_PNG_SUPPORT
97+ const bool SXBP_PNG_SUPPORT = true;
98+ #else
99+ const bool SXBP_PNG_SUPPORT = false;
100+ #endif
97101
98102/*
99103 * given a bitmap_t struct and a pointer to a blank buffer_t, write the bitmap
@@ -112,7 +116,7 @@ sxbp_status_t sxbp_render_backend_png(
112116 assert (bitmap .pixels != NULL );
113117 assert (buffer -> bytes == NULL );
114118 // only do PNG operations if support is enabled
115- #ifndef SAXBOSPIRAL_PNG_SUPPORT
119+ #ifndef LIBSXBP_PNG_SUPPORT
116120 // return SXBP_NOT_IMPLEMENTED
117121 return SXBP_NOT_IMPLEMENTED ;
118122 #else
@@ -206,7 +210,7 @@ sxbp_status_t sxbp_render_backend_png(
206210 // status ok
207211 result = SXBP_OPERATION_OK ;
208212 return result ;
209- #endif // SAXBOSPIRAL_PNG_SUPPORT
213+ #endif // LIBSXBP_PNG_SUPPORT
210214}
211215
212216#ifdef __cplusplus
0 commit comments