소스 검색

raylib.h: include <stdbool.h> if available

Previously, if <raylib.h> was #included prior to another header that
defined bool, the compilation would fail.
This is e.g. the case for <perl.h> and <objc/objc.h> which both fall
back to the <stdbool.h> if C99 is available.

The following commit includes <objc/objc.h> in src/core.c, which causes
the same problem.

Avoid this by checking for C99 bool like we already do for C++'s.
pull/655/head
Ahmad Fatoum 7 년 전
부모
커밋
6572d5ff8c
No known key found for this signature in database GPG 키 ID: C3EAC3DE9321D59B
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -4
      src/raylib.h

+ 4
- 4
src/raylib.h 파일 보기

@ -354,11 +354,11 @@
//----------------------------------------------------------------------------------
// Structures Definition
//----------------------------------------------------------------------------------
#ifndef __cplusplus
// Boolean type
#ifndef bool
typedef enum { false, true } bool;
#endif
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool)
typedef enum { false, true } bool;
#endif
// Vector2 type

불러오는 중...
취소
저장