forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-41681: [GLib] Generate separate version macros for each GLib…
… library (apache#41721) ### Rationale for this change This is to support later using the `*_AVAILABLE_IN_*` macros to add `dllexport/dllimport` attributes required for building these libraries with MSVC (apache#41134) ### What changes are included in this PR? * Add a Python script that generates `DEPRECATED_IN` and `AVAILABLE_IN` macros for each GLib library * Add missing `AVAILABLE_IN` annotations to some methods in the GLib libraries (except the main arrow-glib library as this is being done in apache#41599) ### Are these changes tested? This doesn't include any behaviour change that can be unit tested. ### Are there any user-facing changes? No * GitHub Issue: apache#41681 Lead-authored-by: Adam Reeve <adreeve@gmail.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
- Loading branch information
Showing
49 changed files
with
1,492 additions
and
812 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,6 @@ | |
|
||
#include <arrow-glib/arrow-glib.h> | ||
|
||
#include <arrow-cuda-glib/version.h> | ||
|
||
#include <arrow-cuda-glib/cuda.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <arrow-glib/version.h> | ||
|
||
/** | ||
* SECTION: version | ||
* @section_id: version-macros | ||
* @title: Version related macros | ||
* @include: arrow-cuda-glib/arrow-cuda-glib.h | ||
* | ||
* Apache Arrow CUDA GLib provides macros that can be used by C pre-processor. | ||
* They are useful to check version related things at compile time. | ||
*/ | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_MAJOR: | ||
* | ||
* The major version. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#define GARROW_CUDA_VERSION_MAJOR (@VERSION_MAJOR@) | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_MINOR: | ||
* | ||
* The minor version. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#define GARROW_CUDA_VERSION_MINOR (@VERSION_MINOR@) | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_MICRO: | ||
* | ||
* The micro version. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#define GARROW_CUDA_VERSION_MICRO (@VERSION_MICRO@) | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_TAG: | ||
* | ||
* The version tag. Normally, it's an empty string. It's "SNAPSHOT" | ||
* for snapshot version. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#define GARROW_CUDA_VERSION_TAG "@VERSION_TAG@" | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_CHECK: | ||
* @major: A major version to check for. | ||
* @minor: A minor version to check for. | ||
* @micro: A micro version to check for. | ||
* | ||
* You can use this macro in C pre-processor. | ||
* | ||
* Returns: %TRUE if the compile time Apache Arrow GLib version is the | ||
* same as or newer than the passed version, %FALSE otherwise. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#define GARROW_CUDA_VERSION_CHECK(major, minor, micro) \ | ||
(GARROW_CUDA_VERSION_MAJOR > (major) || \ | ||
(GARROW_CUDA_VERSION_MAJOR == (major) && \ | ||
GARROW_CUDA_VERSION_MINOR > (minor)) || \ | ||
(GARROW_CUDA_VERSION_MAJOR == (major) && \ | ||
GARROW_CUDA_VERSION_MINOR == (minor) && \ | ||
GARROW_CUDA_VERSION_MICRO >= (micro))) | ||
|
||
/** | ||
* GARROW_CUDA_DISABLE_DEPRECATION_WARNINGS: | ||
* | ||
* If this macro is defined, no deprecated warnings are produced. | ||
* | ||
* You must define this macro before including the | ||
* arrow-glib/arrow-glib.h header. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
|
||
#ifdef GARROW_CUDA_DISABLE_DEPRECATION_WARNINGS | ||
# define GARROW_CUDA_DEPRECATED | ||
# define GARROW_CUDA_DEPRECATED_FOR(function) | ||
# define GARROW_CUDA_UNAVAILABLE(major, minor) | ||
#else | ||
# define GARROW_CUDA_DEPRECATED G_DEPRECATED | ||
# define GARROW_CUDA_DEPRECATED_FOR(function) G_DEPRECATED_FOR(function) | ||
# define GARROW_CUDA_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor) | ||
#endif | ||
|
||
@ENCODED_VERSIONS@ | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_MIN_REQUIRED: | ||
* | ||
* You can use this macro for compile time API version check. | ||
* | ||
* This macro value must be one of the predefined version macros such | ||
* as %GARROW_CUDA_VERSION_0_10. | ||
* | ||
* If you use any functions that is defined by newer version than | ||
* %GARROW_CUDA_VERSION_MIN_REQUIRED, deprecated warnings are produced at | ||
* compile time. | ||
* | ||
* You must define this macro before including the | ||
* arrow-cuda-glib/arrow-cuda-glib.h header. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#ifndef GARROW_CUDA_VERSION_MIN_REQUIRED | ||
# define GARROW_CUDA_VERSION_MIN_REQUIRED GARROW_VERSION_MIN_REQUIRED | ||
#endif | ||
|
||
/** | ||
* GARROW_CUDA_VERSION_MAX_ALLOWED: | ||
* | ||
* You can use this macro for compile time API version check. | ||
* | ||
* This macro value must be one of the predefined version macros such | ||
* as %GARROW_CUDA_VERSION_0_10. | ||
* | ||
* If you use any functions that is defined by newer version than | ||
* %GARROW_CUDA_VERSION_MAX_ALLOWED, deprecated warnings are produced at | ||
* compile time. | ||
* | ||
* You must define this macro before including the | ||
* arrow-cuda-glib/arrow-cuda-glib.h header. | ||
* | ||
* Since: 17.0.0 | ||
*/ | ||
#ifndef GARROW_CUDA_VERSION_MAX_ALLOWED | ||
# define GARROW_CUDA_VERSION_MAX_ALLOWED GARROW_VERSION_MAX_ALLOWED | ||
#endif | ||
|
||
@AVAILABILITY_MACROS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.