diff --git a/src/nanovg.h b/src/nanovg.h index 9718ba8..20ee98c 100644 --- a/src/nanovg.h +++ b/src/nanovg.h @@ -437,7 +437,14 @@ struct NVGparams { struct NVGcontext* nvgCreateInternal(struct NVGparams* params); void nvgDeleteInternal(struct NVGcontext* ctx); -#define NVG_NOTUSED(v) (void)sizeof(v) +// Compiler references +// http://sourceforge.net/p/predef/wiki/Compilers/ +#if _MSC_VER >= 1800 + // VS 2013 seems to be too smart for school, it will still list the variable as unused if passed into sizeof(). + #define NVG_NOTUSED(v) do { (void)(v); } while(0) +#else + #define NVG_NOTUSED(v) (void)sizeof(v) +#endif #ifdef __cplusplus } diff --git a/src/nanovg_gl2.h b/src/nanovg_gl2.h index 654dfcb..6994772 100644 --- a/src/nanovg_gl2.h +++ b/src/nanovg_gl2.h @@ -728,7 +728,7 @@ static void glnvg__renderFill(void* uptr, struct NVGpaint* paint, struct NVGscis glDisable(GL_BLEND); glEnable(GL_STENCIL_TEST); glStencilMask(0xff); - glStencilFunc(GL_ALWAYS, 0, ~0); + glStencilFunc(GL_ALWAYS, 0, ~0U); glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); glUseProgram(gl->shader.prog);