Subversion Repositories Tewi

Rev

Rev 213 | Rev 219 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 213 Rev 215
Line 1... Line 1...
1
/* $Id: main.c 213 2024-10-02 17:45:40Z nishi $ */
1
/* $Id: main.c 215 2024-10-02 19:24:43Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
7
#ifndef _MSC_VER
7
#ifdef __BORLANDC__
-
 
8
 
-
 
9
#pragma resource "tewi_bcc.res"
-
 
10
 
-
 
11
#endif
-
 
12
 
-
 
13
#if !defined(_MSC_VER) && !defined(__BORLANDC__)
8
#include <unistd.h>
14
#include <unistd.h>
9
#endif
15
#endif
10
#include <stdio.h>
16
#include <stdio.h>
11
#include <stdbool.h>
17
#include <stdbool.h>
12
#include <string.h>
18
#include <string.h>
Line 22... Line 28...
22
 
28
 
23
#include "tw_config.h"
29
#include "tw_config.h"
24
#include "tw_server.h"
30
#include "tw_server.h"
25
#include "tw_version.h"
31
#include "tw_version.h"
26
 
32
 
27
#if defined(__MINGW32__) || defined(_MSC_VER)
33
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
28
#include <windows.h>
34
#include <windows.h>
29
#endif
35
#endif
30
 
36
 
31
#ifdef _PSP
37
#ifdef _PSP
32
#include <pspkernel.h>
38
#include <pspkernel.h>
Line 59... Line 65...
59
#include <stdarg.h>
65
#include <stdarg.h>
60
#include <png.h>
66
#include <png.h>
61
 
67
 
62
#define printf(...) tt_printf(__VA_ARGS__)
68
#define printf(...) tt_printf(__VA_ARGS__)
63
#define STDERR_LOG(...) tt_printf(__VA_ARGS__)
69
#define STDERR_LOG(...) tt_printf(__VA_ARGS__)
64
#elif defined(_MSC_VER)
70
#elif defined(_MSC_VER) || defined(__BORLANDC__)
65
void STDERR_LOG(const char* format, ...) {
71
void STDERR_LOG(const char* format, ...) {
66
	va_list args;
72
	va_list args;
67
	va_start(args, format);
73
	va_start(args, format);
68
	vfprintf(stderr, format, args);
74
	vfprintf(stderr, format, args);
69
	va_end(args);
75
	va_end(args);
Line 781... Line 787...
781
	}
787
	}
782
	sprintf(tw_server, "Tewi/%s (%s)%s", tw_get_version(), tw_get_platform(), config.extension == NULL ? "" : config.extension);
788
	sprintf(tw_server, "Tewi/%s (%s)%s", tw_get_version(), tw_get_platform(), config.extension == NULL ? "" : config.extension);
783
	r = cm_strcat(tw_server, " running...");
789
	r = cm_strcat(tw_server, " running...");
784
	cm_force_log(r);
790
	cm_force_log(r);
785
	free(r);
791
	free(r);
786
#if !defined(__MINGW32__) && !defined(_MSC_VER)
792
#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__)
787
	signal(SIGCHLD, SIG_IGN);
793
	signal(SIGCHLD, SIG_IGN);
788
	signal(SIGPIPE, SIG_IGN);
794
	signal(SIGPIPE, SIG_IGN);
789
#else
795
#else
790
	SetConsoleTitle(tw_server);
796
	SetConsoleTitle(tw_server);
791
#endif
797
#endif