2013-09-07 2 views
1

의 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 
+10

대부분의 컴파일러를 사용하면 전 처리기 출력을 볼 수 있습니다. 예를 들어,'-E' 플래그로 GCC를 실행하십시오. –

+4

언뜻보기에 나는 동등성에 대한 대답이 "아니오"라고 대답 할 것입니다. 'PNG_FUNCTION' 매크로를 번역 할 때 존재하지 않는 쉼표를 삽입했다고 생각합니다. 그리고 SO 코드 파싱 서비스에 오신 것을 환영합니다. ;) – lurker

+0

@mbratch에 의한 코멘트의 종결 :'extern attributes '가 있어야합니다.'extern attributes'가 있어야합니다. –

답변

1

@OliverCharlesworth 썼다 :

대부분의 컴파일러는 전처리 출력을 볼 수 있도록 . 예를 들어, -E 플래그로 GCC를 실행하십시오.

@lurker 작성 : 첫 눈에

, 나는 등가의 질문에 대한 대답은 "아니오"이다 말할 것입니다. PNG_FUNCTION 매크로를 번역 할 때 존재하지 않는 쉼표를 삽입했다고 생각합니다. 그리고 SO 코드 파싱 서비스에 오신 것을 환영합니다. ;)

는 @JonathanLeffler 썼다 : 당신은 그냥 extern attributes을해야하는 위치

당신이 extern attributes, 있습니다.

+0

([댓글에 응답하고 커뮤니티 위키로 변환] (http://meta.stackoverflow.com/questions/251597/question-with- 코멘트가 아니라 해답이 없음)) –