Skip to content

Dependency c header instead of cpp header#15

Merged
vongosling merged 7 commits intoapache:masterfrom
jsj020122:master
Nov 30, 2018
Merged

Dependency c header instead of cpp header#15
vongosling merged 7 commits intoapache:masterfrom
jsj020122:master

Conversation

@jsj020122
Copy link
Contributor

1.move ROCKETMQCLIENT_EXPORTS to common.h

@jsj020122
Copy link
Contributor Author

move define to common.h

#else
#define ROCKETMQCLIENT_API
#endif
#include "CCommon.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the two sets of Interfaces independent of each other. This macro can be repeatedly defined here.
Please remove the reference of the c head file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the cpp also need exports class and function
1.CPP interface will depend on C interface .
2. C interface independent the CPP interface

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macro ROCKETMQCLIENT_API should be definded in CPP and C head file independently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,add a new file CPPCommon.h,pls check new commit.


#ifndef __C_COMMON_H__
#define __C_COMMON_H__
#include "RocketMQClient.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this include head file.

#else
#define ROCKETMQCLIENT_API
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this macro here, it is not necessary to create a new head file, i think.

#ifdef __cplusplus
};
#endif
#endif //__C_COMMON_H__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to move this macro to the old head file RocketMQClient.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,remove CPPCommon.h .

@vongosling vongosling added the enhancement New feature or request label Nov 29, 2018
Copy link
Member

@ShannonDing ShannonDing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM

@vongosling vongosling changed the title move define to common.h Dependency c header instead of cpp header Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants