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

src/mongoc/mongoc-cursor-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_PRIVATE_H
1924
#define MONGOC_CURSOR_PRIVATE_H
2025

src/mongoc/mongoc-database-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_DATABASE_PRIVATE_H
1924
#define MONGOC_DATABASE_PRIVATE_H
2025

src/mongoc/mongoc-errno-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_ERRNO_PRIVATE_H
1924
#define MONGOC_ERRNO_PRIVATE_H
2025

src/mongoc/mongoc-gridfs-file-list-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_GRIDFS_FILE_LIST_PRIVATE_H
1924
#define MONGOC_GRIDFS_FILE_LIST_PRIVATE_H
2025

src/mongoc/mongoc-gridfs-file-page-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_GRIDFS_FILE_PAGE_PRIVATE_H
1924
#define MONGOC_GRIDFS_FILE_PAGE_PRIVATE_H
2025

src/mongoc/mongoc-gridfs-file-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_GRIDFS_FILE_PRIVATE_H
1924
#define MONGOC_GRIDFS_FILE_PRIVATE_H
2025

src/mongoc/mongoc-gridfs-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_GRIDFS_PRIVATE_H
1924
#define MONGOC_GRIDFS_PRIVATE_H
2025

src/mongoc/mongoc-host-list-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_HOST_LIST_PRIVATE_H
1924
#define MONGOC_HOST_LIST_PRIVATE_H
2025

src/mongoc/mongoc-list-private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717

18-
#if !defined (MONGOC_INSIDE) && !defined (MONGOC_COMPILATION)
19-
# error "Only <mongoc.h> can be included directly."
18+
#if !defined (MONGOC_I_AM_A_DRIVER) && !defined (MONGOC_COMPILATION)
19+
#error "Only <mongoc.h> can be included directly."
2020
#endif
2121

2222

src/mongoc/mongoc-matcher-op-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_MATCHER_OP_PRIVATE_H
1924
#define MONGOC_MATCHER_OP_PRIVATE_H
2025

src/mongoc/mongoc-matcher-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_MATCHER_PRIVATE_H
1924
#define MONGOC_MATCHER_PRIVATE_H
2025

src/mongoc/mongoc-queue-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_QUEUE_PRIVATE_H
1924
#define MONGOC_QUEUE_PRIVATE_H
2025

src/mongoc/mongoc-read-prefs-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_READ_PREFS_PRIVATE_H
1924
#define MONGOC_READ_PREFS_PRIVATE_H
2025

src/mongoc/mongoc-rpc-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_RPC_PRIVATE_H
1924
#define MONGOC_RPC_PRIVATE_H
2025

src/mongoc/mongoc-sasl-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_SASL_PRIVATE_H
1924
#define MONGOC_SASL_PRIVATE_H
2025

src/mongoc/mongoc-ssl-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_SSL_PRIVATE_H
1924
#define MONGOC_SSL_PRIVATE_H
2025

src/mongoc/mongoc-stream-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_STREAM_PRIVATE_H
1924
#define MONGOC_STREAM_PRIVATE_H
2025

src/mongoc/mongoc-thread-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_THREAD_PRIVATE_H
1924
#define MONGOC_THREAD_PRIVATE_H
2025

src/mongoc/mongoc-util-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_UTIL_PRIVATE_H
1924
#define MONGOC_UTIL_PRIVATE_H
2025

src/mongoc/mongoc-write-command-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_WRITE_COMMAND_PRIVATE_H
1924
#define MONGOC_WRITE_COMMAND_PRIVATE_H
2025

src/mongoc/mongoc-write-concern-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_WRITE_CONCERN_PRIVATE_H
1924
#define MONGOC_WRITE_CONCERN_PRIVATE_H
2025

0 commit comments

Comments
 (0)