Skip to content

Commit b5a3ef3

Browse files
authored
Merge pull request libgit2#4944 from libgit2/ethomson/deprecation
Improve deprecation of old enums
2 parents 1758636 + 1b2af79 commit b5a3ef3

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

include/git2/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typedef size_t size_t;
5959
#if defined(__GNUC__)
6060
# define GIT_DEPRECATED(func) \
6161
__attribute__((deprecated)) \
62+
__attribute__((used)) \
6263
func
6364
#elif defined(_MSC_VER)
6465
# define GIT_DEPRECATED(func) __declspec(deprecated) func

include/git2/refs.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -762,18 +762,18 @@ GIT_EXTERN(const char *) git_reference_shorthand(const git_reference *ref);
762762
#define git_ref_t git_reference_t
763763
#define git_reference_normalize_t git_reference_format_t
764764

765-
GIT_DEPRECATED(static const unsigned int) GIT_REF_INVALID = GIT_REFERENCE_INVALID;
766-
GIT_DEPRECATED(static const unsigned int) GIT_REF_OID = GIT_REFERENCE_DIRECT;
767-
GIT_DEPRECATED(static const unsigned int) GIT_REF_SYMBOLIC = GIT_REFERENCE_SYMBOLIC;
768-
GIT_DEPRECATED(static const unsigned int) GIT_REF_LISTALL = GIT_REFERENCE_ALL;
765+
GIT_DEPRECATED(static const git_ref_t) GIT_REF_INVALID = GIT_REFERENCE_INVALID;
766+
GIT_DEPRECATED(static const git_ref_t) GIT_REF_OID = GIT_REFERENCE_DIRECT;
767+
GIT_DEPRECATED(static const git_ref_t) GIT_REF_SYMBOLIC = GIT_REFERENCE_SYMBOLIC;
768+
GIT_DEPRECATED(static const git_ref_t) GIT_REF_LISTALL = GIT_REFERENCE_ALL;
769769

770-
GIT_DEPRECATED(static const unsigned int) GIT_REF_FORMAT_NORMAL =
770+
GIT_DEPRECATED(static const git_reference_normalize_t) GIT_REF_FORMAT_NORMAL =
771771
GIT_REFERENCE_FORMAT_NORMAL;
772-
GIT_DEPRECATED(static const unsigned int) GIT_REF_FORMAT_ALLOW_ONELEVEL =
772+
GIT_DEPRECATED(static const git_reference_normalize_t) GIT_REF_FORMAT_ALLOW_ONELEVEL =
773773
GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL;
774-
GIT_DEPRECATED(static const unsigned int) GIT_REF_FORMAT_REFSPEC_PATTERN =
774+
GIT_DEPRECATED(static const git_reference_normalize_t) GIT_REF_FORMAT_REFSPEC_PATTERN =
775775
GIT_REFERENCE_FORMAT_REFSPEC_PATTERN;
776-
GIT_DEPRECATED(static const unsigned int) GIT_REF_FORMAT_REFSPEC_SHORTHAND =
776+
GIT_DEPRECATED(static const git_reference_normalize_t) GIT_REF_FORMAT_REFSPEC_SHORTHAND =
777777
GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND;
778778

779779
/**@}*/

include/git2/types.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -450,19 +450,19 @@ typedef struct git_mailmap git_mailmap;
450450

451451
/**@{*/
452452

453-
GIT_DEPRECATED(static const int) GIT_OBJ_ANY = GIT_OBJECT_ANY;
454-
GIT_DEPRECATED(static const int) GIT_OBJ_BAD = GIT_OBJECT_INVALID;
455-
GIT_DEPRECATED(static const int) GIT_OBJ__EXT1 = 0;
456-
GIT_DEPRECATED(static const int) GIT_OBJ_COMMIT = GIT_OBJECT_COMMIT;
457-
GIT_DEPRECATED(static const int) GIT_OBJ_TREE = GIT_OBJECT_TREE;
458-
GIT_DEPRECATED(static const int) GIT_OBJ_BLOB = GIT_OBJECT_BLOB;
459-
GIT_DEPRECATED(static const int) GIT_OBJ_TAG = GIT_OBJECT_TAG;
460-
GIT_DEPRECATED(static const int) GIT_OBJ__EXT2 = 5;
461-
GIT_DEPRECATED(static const int) GIT_OBJ_OFS_DELTA = GIT_OBJECT_OFS_DELTA;
462-
GIT_DEPRECATED(static const int) GIT_OBJ_REF_DELTA = GIT_OBJECT_REF_DELTA;
463-
464453
#define git_otype git_object_t
465454

455+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_ANY = GIT_OBJECT_ANY;
456+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_BAD = GIT_OBJECT_INVALID;
457+
GIT_DEPRECATED(static const git_otype) GIT_OBJ__EXT1 = 0;
458+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_COMMIT = GIT_OBJECT_COMMIT;
459+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_TREE = GIT_OBJECT_TREE;
460+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_BLOB = GIT_OBJECT_BLOB;
461+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_TAG = GIT_OBJECT_TAG;
462+
GIT_DEPRECATED(static const git_otype) GIT_OBJ__EXT2 = 5;
463+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_OFS_DELTA = GIT_OBJECT_OFS_DELTA;
464+
GIT_DEPRECATED(static const git_otype) GIT_OBJ_REF_DELTA = GIT_OBJECT_REF_DELTA;
465+
466466
/**@}*/
467467

468468
/** @} */

0 commit comments

Comments
 (0)