Skip to content

Commit 53d13fb

Browse files
committed
deprecation: deprecated stream registration in if guard
`git_stream_register_tls` is now deprecated; mark it in an if guard with the deprecation. This should not be included in `deprecated.h` since it is an uncommonly used `sys` header file.
1 parent 769e927 commit 53d13fb

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

include/git2/sys/stream.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ typedef enum {
9898
GIT_EXTERN(int) git_stream_register(
9999
git_stream_t type, git_stream_registration *registration);
100100

101+
#ifndef GIT_DEPRECATE_HARD
102+
101103
/** @name Deprecated TLS Stream Registration Functions
102104
*
103-
* These typedefs and functions are retained for backward compatibility.
104-
* The newer versions of these functions and structures should be preferred
105-
* in all new code.
105+
* These functions are retained for backward compatibility. The newer
106+
* versions of these values should be preferred in all new code.
107+
*
108+
* There is no plan to remove these backward compatibility values at
109+
* this time.
106110
*/
107-
108111
/**@{*/
109112

110113
/**
@@ -115,14 +118,20 @@ typedef int GIT_CALLBACK(git_stream_cb)(git_stream **out, const char *host, cons
115118

116119
/**
117120
* Register a TLS stream constructor for the library to use. This stream
118-
* will not support HTTP CONNECT proxies.
121+
* will not support HTTP CONNECT proxies. This internally calls
122+
* `git_stream_register` and is preserved for backward compatibility.
123+
*
124+
* This function is deprecated, but there is no plan to remove this
125+
* function at this time.
119126
*
120127
* @deprecated Provide a git_stream_registration to git_stream_register
121128
* @see git_stream_register
122129
*/
123130
GIT_EXTERN(int) git_stream_register_tls(git_stream_cb ctor);
124131

125-
/**@}*/
132+
/**@}*/
133+
134+
#endif
126135

127136
GIT_END_DECL
128137

0 commit comments

Comments
 (0)