의 libpng의 pngconf.h에서 가져온 다음
의 libpng 버전 1.6.3 - 2013년 7월 18일
저작권 (C) 1998에서 2013 사이 글렌 데르-Pehrson매크로 등가
내 질문은, 다음과 같은 매크로 전 처리기를 제공합니다 :
#ifndef PNG_FUNCTION
#define PNG_FUNCTION(type, name, args, attributes) attributes type name args
#endif
#ifndef PNG_EXPORTA
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
extern attributes)
#endif
#ifndef PNG_EXPORT_TYPE
#define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
#endif
#ifndef PNGAPI
#define PNGAPI PNGCAPI
#endif
#define PNGCAPI __cdecl
#ifndef PNGARG
#define PNGARG(arglist) arglist
#endif
다음과 동등한 무엇입니까? 에 마지막으로 동일하다
#ifndef PNG_EXPORTA
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
extern attributes PNG_EXPORT_TYPE(type) (PNGCAPI name) PNGARG(args)
#endif
:
#ifndef PNG_EXPORTA
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
extern attributes)
#endif
은 동일합니다
#ifndef PNG_EXPORTA
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
extern attributes PNG_IMPEXP type __cdecl name arglist
#endif
대부분의 컴파일러를 사용하면 전 처리기 출력을 볼 수 있습니다. 예를 들어,'-E' 플래그로 GCC를 실행하십시오. –
언뜻보기에 나는 동등성에 대한 대답이 "아니오"라고 대답 할 것입니다. 'PNG_FUNCTION' 매크로를 번역 할 때 존재하지 않는 쉼표를 삽입했다고 생각합니다. 그리고 SO 코드 파싱 서비스에 오신 것을 환영합니다. ;) – lurker
@mbratch에 의한 코멘트의 종결 :'extern attributes '가 있어야합니다.'extern attributes'가 있어야합니다. –