Skip to content

CDRIVER-5866 Use consistent syntax for include directives #1840

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

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .evergreen/scripts/check-preludes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
MONGOC_PREFIX / "mongoc-prelude.h",
MONGOC_PREFIX / "mongoc.h",
],
"include": '#include "mongoc-prelude.h"',
"include": '#include <mongoc/mongoc-prelude.h>',
},
{
"name": "libbson",
Expand All @@ -50,7 +50,7 @@
"name": "common",
"headers": list(COMMON_PREFIX.glob("*.h")),
"exclusions": [COMMON_PREFIX / "common-prelude.h"],
"include": '#include "common-prelude.h"',
"include": '#include <common-prelude.h>',
},
]

Expand Down
9 changes: 4 additions & 5 deletions build/future_function_templates/future-functions.c.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* controlling the server from the main thread.
*/

#include "mongoc/mongoc-topology-private.h"
#include <mongoc/mongoc-topology-private.h>

#include "future-functions.h"
#include "mock_server/future-functions.h"

{% for F in future_functions %}
static
Expand All @@ -41,8 +41,8 @@ BSON_THREAD_FUN (background_{{ F.name }}, data)
BSON_THREAD_RETURN;
}
{% endfor %}

{% for F in future_functions %}

future_t *
{{ F|future_function_name }} ({% for P in F.params %}
{{ P.type_name }} {{ P.name }}{% if not loop.last %},{% endif %}{% endfor %})
Expand All @@ -56,5 +56,4 @@ future_t *
future_start (future, background_{{ F.name }});
return future;
}
{% endfor %}

{%- endfor %}
6 changes: 3 additions & 3 deletions build/future_function_templates/future-functions.h.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef FUTURE_FUNCTIONS_H
#define FUTURE_FUNCTIONS_H

#include "future-value.h"
#include "future.h"
#include "mongoc/mongoc-bulk-operation.h"
#include "mock_server/future-value.h"
#include "mock_server/future.h"
#include <mongoc/mongoc-bulk-operation.h>

{{ header_comment }}

Expand Down
6 changes: 3 additions & 3 deletions build/future_function_templates/future-value.c.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "future-value.h"
#include "mock_server/future-value.h"

{{ header_comment }}

Expand All @@ -19,8 +19,8 @@ future_value_get_void (future_value_t *future_value)
{
BSON_ASSERT (future_value->type == future_value_void_type);
}

{% for T in type_list %}

void
future_value_set_{{ T }} (future_value_t *future_value, {{ T }} value)
{
Expand All @@ -34,4 +34,4 @@ future_value_get_{{ T }} (future_value_t *future_value)
BSON_ASSERT (future_value->type == future_value_{{ T }}_type);
return future_value->value.{{ T }}_value;
}
{% endfor %}
{%- endfor %}
4 changes: 2 additions & 2 deletions build/future_function_templates/future-value.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <mongoc/mongoc.h>


#include "mongoc/mongoc-cluster-private.h"
#include "mongoc/mongoc-topology-private.h"
#include <mongoc/mongoc-cluster-private.h>
#include <mongoc/mongoc-topology-private.h>


{{ header_comment }}
Expand Down
6 changes: 3 additions & 3 deletions build/future_function_templates/future.c.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <stdio.h>

#include "mongoc/mongoc-array-private.h"
#include "mongoc/mongoc-thread-private.h"
#include "future.h"
#include <mongoc/mongoc-array-private.h>
#include <mongoc/mongoc-thread-private.h>
#include "mock_server/future.h"
#include "../test-libmongoc.h"

{{ header_comment }}
Expand Down
5 changes: 2 additions & 3 deletions build/future_function_templates/future.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <bson/bson.h>

#include "future-value.h"
#include "mongoc/mongoc-thread-private.h"
#include "mock_server/future-value.h"
#include <mongoc/mongoc-thread-private.h>

{{ header_comment }}

Expand Down Expand Up @@ -42,4 +42,3 @@ future_get_{{ T }} (future_t *future);
void future_destroy (future_t *future);

#endif /* FUTURE_H */

8 changes: 4 additions & 4 deletions build/opts_templates/mongoc-opts-private.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

#include "mongoc-prelude.h"
#include <mongoc/mongoc-prelude.h>

#ifndef MONGOC_OPTS_H
#define MONGOC_OPTS_H

#include <bson/bson.h>

#include "mongoc-client-session.h"
#include "mongoc-bulk-operation-private.h"
#include "mongoc-opts-helpers-private.h"
#include <mongoc/mongoc-client-session.h>
#include <mongoc/mongoc-bulk-operation-private.h>
#include <mongoc/mongoc-opts-helpers-private.h>

{{ header_comment }}

Expand Down
10 changes: 5 additions & 5 deletions build/opts_templates/mongoc-opts.c.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "mongoc-opts-helpers-private.h"
#include "mongoc-opts-private.h"
#include "mongoc-error.h"
#include "mongoc-util-private.h"
#include "mongoc-client-private.h"
#include <mongoc/mongoc-opts-helpers-private.h>
#include <mongoc/mongoc-opts-private.h>
#include <mongoc/mongoc-error.h>
#include <mongoc/mongoc-util-private.h>
#include <mongoc/mongoc-client-private.h>

{{ header_comment }}
{% for struct_type, description in opts_structs.items() %}
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-atomic-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>


#ifndef MONGO_C_DRIVER_COMMON_ATOMIC_PRIVATE_H
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-b64-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_B64_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_B64_PRIVATE_H
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/common-b64.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/

#include "bson/bson.h"
#include "common-b64-private.h"
#include <bson/bson.h>
#include <common-b64-private.h>

#define Assert(Cond) \
if (!(Cond)) \
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-bits-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_BITS_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_BITS_PRIVATE_H
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/common-bson-dsl-private.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_BSON_DSL_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_BSON_DSL_PRIVATE_H
Expand All @@ -13,7 +13,7 @@
* For more information about using this DSL, refer to `bson-dsl.md`.
*/

#include "bson/bson.h"
#include <bson/bson.h>
#include <common-cmp-private.h>

enum {
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-cmp-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_CMP_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_CMP_PRIVATE_H
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/common-json-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_JSON_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_JSON_PRIVATE_H

#include "common-string-private.h"
#include <common-string-private.h>

#define mcommon_iso8601_string_append COMMON_NAME (iso8601_string_append)
#define mcommon_json_append_escaped COMMON_NAME (json_append_escaped)
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-macros-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_MACROS_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_MACROS_PRIVATE_H
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/common-md5-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_MD5_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_MD5_PRIVATE_H

#include "bson/bson.h"
#include <bson/bson.h>

BSON_BEGIN_DECLS

Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

#include <string.h>

#include "common-md5-private.h"
#include <common-md5-private.h>

#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */
#if BSON_BYTE_ORDER == BSON_BIG_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-oid-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_OID_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_OID_PRIVATE_H
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/common-string-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_STRING_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_STRING_PRIVATE_H

#include <bson/bson.h>
#include <string.h>
#include "common-cmp-private.h"
#include <common-cmp-private.h>


/* Until the deprecated bson_string_t is removed, this must have the same members in the same order, so we can safely
Expand Down
10 changes: 5 additions & 5 deletions src/common/src/common-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

#include "common-string-private.h"
#include "common-bits-private.h"
#include "common-utf8-private.h"
#include "common-b64-private.h"
#include "common-cmp-private.h"
#include <common-string-private.h>
#include <common-bits-private.h>
#include <common-utf8-private.h>
#include <common-b64-private.h>
#include <common-cmp-private.h>


mcommon_string_t *
Expand Down
12 changes: 6 additions & 6 deletions src/common/src/common-thread-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include "common-config.h"
#include "common-macros-private.h"
#include <common-prelude.h>
#include <common-config.h>
#include <common-macros-private.h>

#ifndef MONGO_C_DRIVER_COMMON_THREAD_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_THREAD_PRIVATE_H

#define BSON_INSIDE
#include "bson/bson-compat.h"
#include "bson/bson-config.h"
#include "bson/bson-macros.h"
#include <bson/bson-compat.h>
#include <bson/bson-config.h>
#include <bson/bson-macros.h>
#undef BSON_INSIDE

BSON_BEGIN_DECLS
Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-thread-private.h"
#include <common-thread-private.h>

#include <errno.h>

Expand Down
2 changes: 1 addition & 1 deletion src/common/src/common-utf8-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "common-prelude.h"
#include <common-prelude.h>

#ifndef MONGO_C_DRIVER_COMMON_UTF8_PRIVATE_H
#define MONGO_C_DRIVER_COMMON_UTF8_PRIVATE_H
Expand Down
2 changes: 1 addition & 1 deletion src/libbson/src/bson/bcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <stdio.h>

#include "bcon.h"
#include <bson/bcon.h>
#include <bson/bson-config.h>

/* These stack manipulation macros are used to manage append recursion in
Expand Down
2 changes: 1 addition & 1 deletion src/libbson/src/bson/bcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef BCON_H_
#define BCON_H_

#include "bson.h"
#include <bson/bson.h>


BSON_BEGIN_DECLS
Expand Down
2 changes: 1 addition & 1 deletion src/libbson/src/bson/bson-context-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


#include <bson/bson-context.h>
#include "common-thread-private.h"
#include <common-thread-private.h>


BSON_BEGIN_DECLS
Expand Down
2 changes: 1 addition & 1 deletion src/libbson/src/bson/bson-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <bson/bson-context.h>
#include <bson/bson-context-private.h>
#include <bson/bson-memory.h>
#include "common-thread-private.h"
#include <common-thread-private.h>


#ifndef HOST_NAME_MAX
Expand Down
2 changes: 1 addition & 1 deletion src/libbson/src/bson/bson-iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define BSON_ITER_H


#include "bson.h"
#include <bson/bson.h>
#include <bson/bson-endian.h>
#include <bson/bson-macros.h>
#include <bson/bson-types.h>
Expand Down
Loading