winlin

refine the macro, use int as version type. 2.0.8

@@ -11,6 +11,12 @@ @@ -11,6 +11,12 @@
11 11
12 #include "public.h" 12 #include "public.h"
13 13
  14 +#if !defined(__ia64__)
  15 + #error "IA64 not supported"
  16 +#else
  17 + #error "Only IA64 supported"
  18 +#endif
  19 +
14 #define srs_trace(msg, ...) printf(msg, ##__VA_ARGS__);printf("\n") 20 #define srs_trace(msg, ...) printf(msg, ##__VA_ARGS__);printf("\n")
15 21
16 int io_port = 1990; 22 int io_port = 1990;
@@ -29,10 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -29,10 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 */ 29 */
30 30
31 // current release version 31 // current release version
32 -#define VERSION_MAJOR "2"  
33 -#define VERSION_MINOR "0"  
34 -#define VERSION_REVISION "7"  
35 -#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 32 +#define VERSION_MAJOR 2
  33 +#define VERSION_MINOR 0
  34 +#define VERSION_REVISION 8
36 // server info. 35 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 36 #define RTMP_SIG_SRS_KEY "SRS"
38 #define RTMP_SIG_SRS_ROLE "origin/edge server" 37 #define RTMP_SIG_SRS_ROLE "origin/edge server"
@@ -46,6 +45,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -46,6 +45,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46 #define RTMP_SIG_SRS_PRIMARY_AUTHROS "winlin,wenjie.zhao" 45 #define RTMP_SIG_SRS_PRIMARY_AUTHROS "winlin,wenjie.zhao"
47 #define RTMP_SIG_SRS_CONTRIBUTORS_URL RTMP_SIG_SRS_URL"/blob/master/AUTHORS.txt" 46 #define RTMP_SIG_SRS_CONTRIBUTORS_URL RTMP_SIG_SRS_URL"/blob/master/AUTHORS.txt"
48 #define RTMP_SIG_SRS_HANDSHAKE RTMP_SIG_SRS_KEY"("RTMP_SIG_SRS_VERSION")" 47 #define RTMP_SIG_SRS_HANDSHAKE RTMP_SIG_SRS_KEY"("RTMP_SIG_SRS_VERSION")"
  48 +#define RTMP_SIG_SRS_RELEASE "https://github.com/winlinvip/simple-rtmp-server/tree/1.0release"
  49 +#define RTMP_SIG_SRS_HTTP_SERVER "https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer#feature"
  50 +#define RTMP_SIG_SRS_VERSION __SRS_XSTR(VERSION_MAJOR)"."__SRS_XSTR(VERSION_MINOR)"."__SRS_XSTR(VERSION_REVISION)
  51 +
  52 +// internal macros, covert macro values to str,
  53 +// see: read https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification
  54 +#define __SRS_XSTR(v) __SRS_STR(v)
  55 +#define __SRS_STR(v) #v
49 56
50 /** 57 /**
51 * the core provides the common defined macros, utilities, 58 * the core provides the common defined macros, utilities,
@@ -491,17 +491,17 @@ int srs_write_packet(srs_rtmp_t rtmp, int type, u_int32_t timestamp, char* data, @@ -491,17 +491,17 @@ int srs_write_packet(srs_rtmp_t rtmp, int type, u_int32_t timestamp, char* data,
491 491
492 int srs_version_major() 492 int srs_version_major()
493 { 493 {
494 - return ::atoi(VERSION_MAJOR); 494 + return VERSION_MAJOR;
495 } 495 }
496 496
497 int srs_version_minor() 497 int srs_version_minor()
498 { 498 {
499 - return ::atoi(VERSION_MINOR); 499 + return VERSION_MINOR;
500 } 500 }
501 501
502 int srs_version_revision() 502 int srs_version_revision()
503 { 503 {
504 - return ::atoi(VERSION_REVISION); 504 + return VERSION_REVISION;
505 } 505 }
506 506
507 int64_t srs_get_time_ms() 507 int64_t srs_get_time_ms()
@@ -60,75 +60,87 @@ SrsServer* _srs_server = new SrsServer(); @@ -60,75 +60,87 @@ SrsServer* _srs_server = new SrsServer();
60 void show_macro_features() 60 void show_macro_features()
61 { 61 {
62 #ifdef SRS_AUTO_SSL 62 #ifdef SRS_AUTO_SSL
63 - srs_trace("rtmp handshake: on"); 63 + srs_trace("check feature rtmp handshake: on");
64 #else 64 #else
65 - srs_warn("rtmp handshake: off"); 65 + srs_warn("check feature rtmp handshake: off");
66 #endif 66 #endif
67 67
68 #ifdef SRS_AUTO_HLS 68 #ifdef SRS_AUTO_HLS
69 - srs_trace("hls: on"); 69 + srs_trace("check feature hls: on");
70 #else 70 #else
71 - srs_warn("hls: off"); 71 + srs_warn("check feature hls: off");
72 #endif 72 #endif
73 73
74 #ifdef SRS_AUTO_HTTP_CALLBACK 74 #ifdef SRS_AUTO_HTTP_CALLBACK
75 - srs_trace("http callback: on"); 75 + srs_trace("check feature http callback: on");
76 #else 76 #else
77 - srs_warn("http callback: off"); 77 + srs_warn("check feature http callback: off");
78 #endif 78 #endif
79 79
80 #ifdef SRS_AUTO_HTTP_API 80 #ifdef SRS_AUTO_HTTP_API
81 - srs_trace("http api: on"); 81 + srs_trace("check feature http api: on");
82 #else 82 #else
83 - srs_warn("http api: off"); 83 + srs_warn("check feature http api: off");
84 #endif 84 #endif
85 85
86 #ifdef SRS_AUTO_HTTP_SERVER 86 #ifdef SRS_AUTO_HTTP_SERVER
87 - srs_trace("http server: on"); 87 + srs_trace("check feature http server: on");
88 #else 88 #else
89 - srs_warn("http server: off"); 89 + srs_warn("check feature http server: off");
90 #endif 90 #endif
91 91
92 #ifdef SRS_AUTO_HTTP_PARSER 92 #ifdef SRS_AUTO_HTTP_PARSER
93 - srs_trace("http parser: on"); 93 + srs_trace("check feature http parser: on");
94 #else 94 #else
95 - srs_warn("http parser: off"); 95 + srs_warn("check feature http parser: off");
96 #endif 96 #endif
97 97
98 #ifdef SRS_AUTO_DVR 98 #ifdef SRS_AUTO_DVR
99 - srs_trace("dvr: on"); 99 + srs_trace("check feature dvr: on");
100 #else 100 #else
101 - srs_warn("dvr: off"); 101 + srs_warn("check feature dvr: off");
102 #endif 102 #endif
103 103
104 #ifdef SRS_AUTO_TRANSCODE 104 #ifdef SRS_AUTO_TRANSCODE
105 - srs_trace("transcode: on"); 105 + srs_trace("check feature transcode: on");
106 #else 106 #else
107 - srs_warn("transcode: off"); 107 + srs_warn("check feature transcode: off");
108 #endif 108 #endif
109 109
110 #ifdef SRS_AUTO_INGEST 110 #ifdef SRS_AUTO_INGEST
111 - srs_trace("ingest: on"); 111 + srs_trace("check feature ingest: on");
112 #else 112 #else
113 - srs_warn("ingest: off"); 113 + srs_warn("check feature ingest: off");
114 #endif 114 #endif
115 115
116 #ifdef SRS_AUTO_STAT 116 #ifdef SRS_AUTO_STAT
117 - srs_trace("system stat: on"); 117 + srs_trace("check feature system stat: on");
118 #else 118 #else
119 - srs_warn("system stat: off"); 119 + srs_warn("check feature system stat: off");
120 #endif 120 #endif
121 121
122 #ifdef SRS_AUTO_NGINX 122 #ifdef SRS_AUTO_NGINX
123 - srs_trace("compile nginx: on"); 123 + srs_trace("check feature compile nginx: on");
124 #else 124 #else
125 - srs_warn("compile nginx: off"); 125 + srs_warn("check feature compile nginx: off");
126 #endif 126 #endif
127 127
128 #ifdef SRS_AUTO_FFMPEG_TOOL 128 #ifdef SRS_AUTO_FFMPEG_TOOL
129 - srs_trace("compile ffmpeg: on"); 129 + srs_trace("check feature compile ffmpeg: on");
130 #else 130 #else
131 - srs_warn("compile ffmpeg: off"); 131 + srs_warn("check feature compile ffmpeg: off");
  132 +#endif
  133 +}
  134 +
  135 +void check_macro_features()
  136 +{
  137 + // for special features.
  138 +#ifdef SRS_AUTO_HTTP_SERVER
  139 + srs_warn("http server is dev feature, @see %s", RTMP_SIG_SRS_HTTP_SERVER);
  140 +#endif
  141 +
  142 +#if VERSION_MAJOR > 1
  143 + srs_warn("SRS %s is develop branch, please use %s instead", RTMP_SIG_SRS_VERSION, RTMP_SIG_SRS_RELEASE);
132 #endif 144 #endif
133 } 145 }
134 146
@@ -149,14 +161,12 @@ int main(int argc, char** argv) @@ -149,14 +161,12 @@ int main(int argc, char** argv)
149 ProfilerStart("gperf.srs.gcp"); 161 ProfilerStart("gperf.srs.gcp");
150 #endif 162 #endif
151 163
152 -#ifdef SRS_AUTO_GPERF_MC  
153 - #ifdef SRS_AUTO_GPERF_MP 164 +#if defined(SRS_AUTO_GPERF_MC) && defined(SRS_AUTO_GPERF_MP)
154 srs_error("option --with-gmc confict with --with-gmp, " 165 srs_error("option --with-gmc confict with --with-gmp, "
155 "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\n" 166 "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\n"
156 "Note that since the heap-checker uses the heap-profiling framework internally, " 167 "Note that since the heap-checker uses the heap-profiling framework internally, "
157 "it is not possible to run both the heap-checker and heap profiler at the same time"); 168 "it is not possible to run both the heap-checker and heap profiler at the same time");
158 return -1; 169 return -1;
159 - #endif  
160 #endif 170 #endif
161 171
162 // never use srs log(srs_trace, srs_error, etc) before config parse the option, 172 // never use srs log(srs_trace, srs_error, etc) before config parse the option,
@@ -190,12 +200,7 @@ int main(int argc, char** argv) @@ -190,12 +200,7 @@ int main(int argc, char** argv)
190 200
191 // features 201 // features
192 show_macro_features(); 202 show_macro_features();
193 -  
194 - // for special features.  
195 -#ifdef SRS_AUTO_HTTP_SERVER  
196 - srs_warn("http server is dev feature, "  
197 - "@see https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_HTTPServer#feature");  
198 -#endif 203 + check_macro_features();
199 204
200 /** 205 /**
201 * we do nothing in the constructor of server, 206 * we do nothing in the constructor of server,