gogyzzz / iip_sph_pp

C library for speech pre-processing.
Mozilla Public License 2.0
11 stars 3 forks source link

C++ 호환 #153

Open kooBH opened 5 years ago

kooBH commented 5 years ago

C++ 에서 C 코드 쓰는 건

#ifdef __cplusplus
extern "C" 
#endif
#include "mother.h"
  #ifdef __cplusplus
}
#endif

하면 되지만

C2059 에러가 발생하는 데 연관된 게시물 https://stackoverflow.com/questions/15734367/error-c2059-syntax-error-when-adding-c-source-files-to-project 를 보면 C99의 양식이 C++과 호환이 되지 않는다고 한다. 하지만 C99양식은 매크로만 사용한 걸로 알고있는데, 그외에 무엇이 더 문제일 지는 살펴봐야함

kooBH commented 5 years ago
#define zeros_load(_x, _3, _2, _1, ...) _1
#define zeros_load_(args_list) zeros_load args_list
#define zeros(...) \
  zeros_load_((__VA_ARGS__, zeros_3d, zeros_2d, zeros_1d)(__VA_ARGS__))

C99 매크로 양식이 호환 되지 않음

cpp이면 오버로딩 가능하니까.. zeros로 래핑?