Skip to content

Commit

Permalink
Use __NEWLIB__ instead of __SWITCH__ and __CYGWIN__ for alloca.h-dete…
Browse files Browse the repository at this point in the history
…ction (#3070)

Cygwin uses newlib, so it's covered by the __NEWLIB__ check.
You can see how it defines __NEWLIB__ here: https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=newlib/configure.in#l453
  • Loading branch information
Clownacy authored Apr 28, 2020
1 parent 8cbff5c commit a2454f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Index of this file:

#include <stdio.h> // vsnprintf, sscanf, printf
#if !defined(alloca)
#if defined(__GLIBC__) || defined(__sun) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__SWITCH__)
#if defined(__GLIBC__) || defined(__sun) || defined(__APPLE__) || defined(__NEWLIB__)
#include <alloca.h> // alloca (glibc uses <alloca.h>. Note that Cygwin may have _WIN32 defined, so the order matters here)
#elif defined(_WIN32)
#include <malloc.h> // alloca
Expand Down

0 comments on commit a2454f2

Please sign in to comment.