File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 100
100
# define Py_UNUSED (name ) _unused_ ## name
101
101
#endif
102
102
103
+ #if defined(RANDALL_WAS_HERE )
104
+ #define Py_UNREACHABLE () do { \
105
+ fputs( \
106
+ "ERROR:\n\n" \
107
+ "If you're seeing this, the code is in what I thought was\n" \
108
+ "an unreachable state.\n\n" \
109
+ "I could give you advice for what to do, but honestly, why\n" \
110
+ "should you trust me? I clearly screwed this up. I'm writing\n" \
111
+ "a message that should never appear, yet I know it will\n" \
112
+ "probably appear someday.\n\n" \
113
+ "On a deep level, I know I'm not up to this task.\n" \
114
+ "I'm so sorry.\n\n" \
115
+ "https://xkcd.com/2200\n", stderr); \
116
+ abort(); \
117
+ } while(0)
118
+ #elif defined(Py_DEBUG )
119
+ #define Py_UNREACHABLE () do { \
120
+ fputs( \
121
+ "ERROR:\n\n" \
122
+ "We've reached an unreachable state. Anything is possible.\n" \
123
+ "The limits were in our heads all along. Follow your dreams.\n\n" \
124
+ "https://xkcd.com/2200\n", stderr); \
125
+ abort(); \
126
+ } while(0)
127
+ #else
103
128
#define Py_UNREACHABLE () abort()
129
+ #endif
104
130
105
131
#endif /* Py_PYMACRO_H */
You can’t perform that action at this time.
0 commit comments