mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	1. `trunk/research/st/exceptions.cpp` About exceptions with ST, works well on linux and mac, not work on cygwin. 2. `trunk/research/st/pthreads.cpp` About pthreads with ST, works well on all platforms. 3. `trunk/research/st/hello.cpp` Hello world, without ST, works well on all platforms. 4. `trunk/research/st/hello-world.cpp` Hello world, with ST, works well on all platforms. 5. `trunk/research/st/hello-st.cpp` A very simple version for hello world with ST, works well on all platforms.
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			308 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			308 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
| g++ hello-world.cpp ../../objs/st/libst.a -g -O0 -o hello-world && ./hello-world
 | |
| */
 | |
| #include <stdio.h>
 | |
| #include "../../objs/st/st.h"
 | |
| 
 | |
| void foo() {
 | |
|     st_init();
 | |
| 
 | |
|     for (int i = 0; ; i++) {
 | |
|         st_sleep(1);
 | |
|         printf("#%d: main: working\n", i);
 | |
|     }
 | |
| }
 | |
| 
 | |
| int main() {
 | |
|     foo();
 | |
|     return 0;
 | |
| }
 |