Commit e7989413a8a5d6e8b2471eefc8372a12e44114a5
Committed by
m-holger
1 parent
20126227
Disable PointerHolder by default
Showing
14 changed files
with
30 additions
and
27 deletions
CMakeLists.txt
| ... | ... | @@ -120,7 +120,6 @@ if(NOT (BUILD_STATIC_LIBS OR BUILD_SHARED_LIBS)) |
| 120 | 120 | endif() |
| 121 | 121 | |
| 122 | 122 | set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) |
| 123 | -add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:POINTERHOLDER_TRANSITION=4>) | |
| 124 | 123 | |
| 125 | 124 | if(ENABLE_QTC) |
| 126 | 125 | set(ENABLE_QTC_ARG) | ... | ... |
ChangeLog
include/qpdf/Buffer.hh
include/qpdf/ClosedFileInputSource.hh
include/qpdf/InputSource.hh
include/qpdf/JSON.hh
include/qpdf/Pipeline.hh
include/qpdf/Pl_Buffer.hh
include/qpdf/Pl_QPDFTokenizer.hh
include/qpdf/PointerHolder.hh
| ... | ... | @@ -26,18 +26,12 @@ |
| 26 | 26 | #define POINTERHOLDER_IS_SHARED_POINTER |
| 27 | 27 | |
| 28 | 28 | #ifndef POINTERHOLDER_TRANSITION |
| 29 | - | |
| 30 | -// #define POINTERHOLDER_TRANSITION 0 to suppress this warning, and see below. | |
| 31 | -// See also https://qpdf.readthedocs.io/en/stable/design.html#smart-pointers | |
| 32 | -# warning "POINTERHOLDER_TRANSITION is not defined -- see qpdf/PointerHolder.hh" | |
| 33 | - | |
| 34 | -// undefined = define as 0 and issue a warning | |
| 35 | 29 | // 0 = no deprecation warnings, backward-compatible API |
| 36 | 30 | // 1 = make PointerHolder<T>(T*) explicit |
| 37 | 31 | // 2 = warn for use of getPointer() and getRefcount() |
| 38 | 32 | // 3 = warn for all use of PointerHolder |
| 39 | 33 | // 4 = don't define PointerHolder at all |
| 40 | -# define POINTERHOLDER_TRANSITION 0 | |
| 34 | +# define POINTERHOLDER_TRANSITION 4 | |
| 41 | 35 | #endif // !defined(POINTERHOLDER_TRANSITION) |
| 42 | 36 | |
| 43 | 37 | #if POINTERHOLDER_TRANSITION < 4 |
| ... | ... | @@ -50,15 +44,19 @@ |
| 50 | 44 | // interface and is mutually assignable with std::shared_ptr. Code |
| 51 | 45 | // that uses containers of PointerHolder will require adjustment. |
| 52 | 46 | |
| 47 | +// In qpdf 11, a backward-compatible PointerHolder was provided with a | |
| 48 | +// warning if POINTERHOLDER_TRANSITION was not defined. Starting in | |
| 49 | +// qpdf 12, PointerHolder is absent if POINTERHOLDER_TRANSITION is not | |
| 50 | +// defined. In a future version of qpdf, PointerHolder will be removed | |
| 51 | +// outright if it becomes inconvenient to keep it around. | |
| 52 | + | |
| 53 | 53 | // *** HOW TO TRANSITION *** |
| 54 | 54 | |
| 55 | 55 | // The symbol POINTERHOLDER_TRANSITION can be defined to help you |
| 56 | 56 | // transition your code away from PointerHolder. You can define it |
| 57 | 57 | // before including any qpdf header files or including its definition |
| 58 | 58 | // in your build configuration. If not defined, it automatically gets |
| 59 | -// defined to 0 (with a warning), which enables full backward | |
| 60 | -// compatibility. That way, you don't have to take action for your | |
| 61 | -// code to continue to work. | |
| 59 | +// defined to 4, which excludes PointerHolder entirely. | |
| 62 | 60 | |
| 63 | 61 | // If you want to work gradually to transition your code away from |
| 64 | 62 | // PointerHolder, you can define POINTERHOLDER_TRANSITION and fix the |
| ... | ... | @@ -123,7 +121,8 @@ |
| 123 | 121 | |
| 124 | 122 | // POINTERHOLDER_TRANSITION = 4 |
| 125 | 123 | // |
| 126 | -// Suppress definition of the PointerHolder<T> type entirely. | |
| 124 | +// Suppress definition of the PointerHolder<T> type entirely. This is | |
| 125 | +// the default behavior starting with qpdf 12. | |
| 127 | 126 | |
| 128 | 127 | // CONST BEHAVIOR |
| 129 | 128 | ... | ... |
job.sums
| 1 | 1 | # Generated by generate_auto_job |
| 2 | -CMakeLists.txt 589283144c7c941ef96a12a7e57c354ec24d845657c919996867c60330501550 | |
| 2 | +CMakeLists.txt f0819695e4867e4f4389d38b0c124e79aa3ec9ace50f16ad8c751ff7f1ec6690 | |
| 3 | 3 | generate_auto_job f64733b79dcee5a0e3e8ccc6976448e8ddf0e8b6529987a66a7d3ab2ebc10a86 |
| 4 | 4 | include/qpdf/auto_job_c_att.hh 4c2b171ea00531db54720bf49a43f8b34481586ae7fb6cbf225099ee42bc5bb4 |
| 5 | 5 | include/qpdf/auto_job_c_copy_att.hh 50609012bff14fd82f0649185940d617d05d530cdc522185c7f3920a561ccb42 | ... | ... |
manual/design.rst
| ... | ... | @@ -860,8 +860,8 @@ modification of code. |
| 860 | 860 | |
| 861 | 861 | The ``POINTERHOLDER_TRANSITION`` preprocessor symbol was introduced in |
| 862 | 862 | qpdf 10.6.0 to help people transition from ``PointerHolder`` to |
| 863 | -``std::shared_ptr``. If you don't define this, you will get a compiler | |
| 864 | -warning. Defining it to any value will suppress the warning. An | |
| 863 | +``std::shared_ptr``. If you don't define this, ``PointerHolder`` will | |
| 864 | +be completely excluded from the API (starting with qpdf 12).An | |
| 865 | 865 | explanation appears below of the different possible values for this |
| 866 | 866 | symbol and what they mean. |
| 867 | 867 | |
| ... | ... | @@ -1003,7 +1003,7 @@ without consulting this manual. |
| 1003 | 1003 | - meaning |
| 1004 | 1004 | |
| 1005 | 1005 | - - undefined |
| 1006 | - - Same as ``0`` but issues a warning | |
| 1006 | + - Same as ``4``: ``PointerHolder`` is not defined. | |
| 1007 | 1007 | |
| 1008 | 1008 | - - ``0`` |
| 1009 | 1009 | - Provide a backward compatible ``PointerHolder`` and suppress | ... | ... |
manual/release-notes.rst
| ... | ... | @@ -29,6 +29,18 @@ Planned changes for future 12.x (subject to change): |
| 29 | 29 | |
| 30 | 30 | .. x.y.z: not yet released |
| 31 | 31 | |
| 32 | +12.0.0: not yet released | |
| 33 | + - Build Changes | |
| 34 | + | |
| 35 | + - If ``POINTERHOLDER_TRANSITION`` is not defined, define it to | |
| 36 | + ``4``, which completely removes ``PointerHolder`` from the API. | |
| 37 | + Stop including it from any headers that used to include it. This | |
| 38 | + means code that hasn't completed its ``PointerHolder`` | |
| 39 | + transition will get errors unless it defines | |
| 40 | + ``POINTERHOLDER_TRANSITION``, and any file that uses | |
| 41 | + ``PointerHolder`` will have to explicitly include it rather than | |
| 42 | + relying on other headers to bring it along. | |
| 43 | + | |
| 32 | 44 | 11.10.1: February 15, 2025 |
| 33 | 45 | - Build fixes |
| 34 | 46 | ... | ... |