Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all struct and typedefs to separate header #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LuxoftAKutsan
Copy link
Contributor

According to C standard :
ISO/IEC 9899:1999 + TC3 6.2.6/6:

The following identifiers have no linkage: an identifier declared to be anything other than an object or a function [...]

ISO/IEC 9899:1999 + TC3 6.2.6/6:

If an identifier has no linkage, there shall be no more than one declaration of the identifier (in a declarator or type specifier) with the same scope and in the same name space, except for tags as specified in 6.7.2.3.

Typedefs cannot be defined multiple times.
Because of that bson_c_lib failes to compile with gcc4.4.2

According to C standard :
ISO/IEC 9899:1999 + TC3 6.2.6/6:
```
The following identifiers have no linkage: an identifier declared to be anything other than an object or a function [...]
```
ISO/IEC 9899:1999 + TC3 6.2.6/6:
```
If an identifier has no linkage, there shall be no more than one declaration of the identifier (in a declarator or type specifier) with the same scope and in the same name space, except for tags as specified in 6.7.2.3.
```

Typedefs cannot be defined multiple times.
Because of that bson_c_lib failes to compile with gcc4.4.2
@LuxoftAKutsan
Copy link
Contributor Author

@JackLivio @jacobkeeler please review

src/bson_fwd.h Outdated
@@ -0,0 +1,75 @@
#ifndef BSON_FWD_H
#define BSON_FWD_H
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe bson_common.h would be a better name? Otherwise, the change looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@jacobkeeler jacobkeeler left a comment

Choose a reason for hiding this comment

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

In addition, you need to add this new header to the include_HEADERS variable in src/Makefile.am, then rerun autoreconf -vfi to apply the changes.

@@ -0,0 +1,75 @@
#ifndef BSON_FWD_H
#define BSON_FWD_H
Copy link
Contributor

Choose a reason for hiding this comment

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

Header guards should be changed accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants