Skip to content

Commit c7f1902

Browse files
author
Christian Hergert
committed
build: allow including private files by drivers
This is meant by drivers that will staticly link libmongoc-priv.a. If you are not doing so, you shouldn't use these.
1 parent d9dfa56 commit c7f1902

31 files changed

+148
-3
lines changed

src/libmongoc-priv.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Description: The libmongoc MongoDB client library, with access to private struct
88
Version: @VERSION@
99
Requires: libbson-1.0
1010
Libs: @SASL_LIBS@ @SSL_LIBS@ @SHM_LIB@ -L${libdir} -lmongoc-priv
11-
Cflags: -DMONGOC_COMPILATION -I${includedir}/libmongoc-@MONGOC_API_VERSION@
11+
Cflags: -DMONGOC_I_AM_A_DRIVER -I${includedir}/libmongoc-@MONGOC_API_VERSION@

src/mongoc/mongoc-array-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_ARRAY_PRIVATE_H
1924
#define MONGOC_ARRAY_PRIVATE_H
2025

src/mongoc/mongoc-buffer-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_BUFFER_PRIVATE_H
1924
#define MONGOC_BUFFER_PRIVATE_H
2025

src/mongoc/mongoc-bulk-operation-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_BULK_OPERATION_PRIVATE_H
1924
#define MONGOC_BULK_OPERATION_PRIVATE_H
2025

src/mongoc/mongoc-client-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_CLIENT_PRIVATE_H
1924
#define MONGOC_CLIENT_PRIVATE_H
2025

src/mongoc/mongoc-cluster-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_CLUSTER_PRIVATE_H
1924
#define MONGOC_CLUSTER_PRIVATE_H
2025

src/mongoc/mongoc-collection-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_COLLECTION_PRIVATE_H
1924
#define MONGOC_COLLECTION_PRIVATE_H
2025

src/mongoc/mongoc-counters-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_COUNTERS_PRIVATE_H
1924
#define MONGOC_COUNTERS_PRIVATE_H
2025

src/mongoc/mongoc-cursor-array-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_CURSOR_ARRAY_PRIVATE_H
1924
#define MONGOC_CURSOR_ARRAY_PRIVATE_H
2025

src/mongoc/mongoc-cursor-cursorid-private.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616

1717

18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
20+
#endif
21+
22+
1823
#ifndef MONGOC_CURSOR_CURSORID_PRIVATE_H
1924
#define MONGOC_CURSOR_CURSORID_PRIVATE_H
2025

0 commit comments

Comments
 (0)