Changeset 212 in Main for trunk/Server/main.c
- Timestamp:
- Oct 3, 2024, 2:44:55 AM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/main.c
r209 r212 5 5 #include "../config.h" 6 6 7 #ifndef _MSC_VER 7 8 #include <unistd.h> 9 #endif 8 10 #include <stdio.h> 9 11 #include <stdbool.h> … … 23 25 #include "tw_version.h" 24 26 25 #if def __MINGW32__27 #if defined(__MINGW32__) || defined(_MSC_VER) 26 28 #include <windows.h> 27 29 #endif … … 60 62 #define printf(...) tt_printf(__VA_ARGS__) 61 63 #define STDERR_LOG(...) tt_printf(__VA_ARGS__) 64 #elif defined(_MSC_VER) 65 void STDERR_LOG(const char* format, ...){ 66 va_list args; 67 va_start(args, format); 68 vfprintf(stderr, format, args); 69 va_end(args); 70 } 62 71 #else 63 72 #define STDERR_LOG(...) fprintf(stderr, __VA_ARGS__) … … 72 81 int startup(int argc, char** argv); 73 82 74 #if def __MINGW32__83 #if defined(__MINGW32__) || defined(_MSC_VER) 75 84 char* get_registry(const char* main, const char* sub) { 76 85 DWORD bufsize = 512; … … 511 520 512 521 int main(int argc, char** argv) { 522 int st; 513 523 logfile = stderr; 514 524 #ifdef SERVICE … … 667 677 SleepThread(); 668 678 #endif 669 intst = startup(argc, argv);679 st = startup(argc, argv); 670 680 if(st != -1) { 671 681 #ifdef _PSP … … 692 702 int startup(int argc, char** argv) { 693 703 int i; 694 #ifdef __MINGW32__ 704 char* r; 705 #if defined(__MINGW32__) || defined(_MSC_VER) 695 706 char* confpath = cm_strdup(PREFIX "/etc/tewi.conf"); 696 707 char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir"); … … 770 781 } 771 782 sprintf(tw_server, "Tewi/%s (%s)%s", tw_get_version(), tw_get_platform(), config.extension == NULL ? "" : config.extension); 772 char*r = cm_strcat(tw_server, " running...");783 r = cm_strcat(tw_server, " running..."); 773 784 cm_force_log(r); 774 785 free(r); 775 #if ndef __MINGW32__786 #if !defined(__MINGW32__) && !defined(_MSC_VER) 776 787 signal(SIGCHLD, SIG_IGN); 777 788 signal(SIGPIPE, SIG_IGN);
Note:
See TracChangeset
for help on using the changeset viewer.