提交 e7c4953c authored 作者: Michael Jerris's avatar Michael Jerris

building (almost working) on windows again

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10936 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 91d50eab
......@@ -21,7 +21,6 @@
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\..\w32\winlibs.vsprops"
CharacterSet="2"
BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
>
......@@ -43,8 +42,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
AdditionalIncludeDirectories="&quot;$(ProjectDir)getopt&quot;;&quot;$(ProjectDir)src/include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -66,6 +65,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib"
OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="$(OutDir)"
......@@ -103,7 +103,6 @@
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\..\w32\winlibs.vsprops"
CharacterSet="2"
BuildLogFile="$(IntDir)\BuildLog $(ProjectName).htm"
>
......@@ -124,8 +123,8 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)\src\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
AdditionalIncludeDirectories="&quot;$(ProjectDir)getopt&quot;;&quot;$(ProjectDir)src/include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="4"
......@@ -144,6 +143,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib"
OutputFile="$(SolutionDir)$(ConfigurationName)/fs_cli.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="$(OutDir)"
......@@ -191,6 +191,10 @@
RelativePath="fs_cli.c"
>
</File>
<File
RelativePath=".\getopt\getopt_long.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
......@@ -198,51 +202,7 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\src\include\switch.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_buffer.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_caller.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_channel.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_config.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_console.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_core.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_frame.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_loadable_module.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_module_interfaces.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_types.h"
>
</File>
<File
RelativePath="..\..\src\include\switch_utils.h"
RelativePath=".\getopt\getopt.h"
>
</File>
</Filter>
......
......@@ -6,6 +6,10 @@
#ifdef WIN32
#define strdup(src) _strdup(src)
#define usleep(time) Sleep(time/1000)
#define fileno _fileno
#define read _read
#include <io.h>
#include <getopt.h>
#else
#include <sys/select.h>
#include <histedit.h>
......@@ -194,15 +198,21 @@ int main(int argc, char *argv[])
int count = 0;
const char *line = NULL;
char cmd_str[1024] = "";
char hfile[512] = "/tmp/fs_cli_history";
char cfile[512] = "/tmp/fs_cli_config";
char *home = getenv("HOME");
esl_config_t cfg;
cli_profile_t *profile = &profiles[0];
int cur = 0;
int opt;
#ifndef WIN32
char hfile[512] = "/tmp/fs_cli_history";
char cfile[512] = "/tmp/fs_cli_config";
char *home = getenv("HOME");
#else
char hfile[512] = "c:\\fs_cli_history";
char cfile[512] = "c:\\fs_cli_config";
char *home = getenv("HOME");
#endif
strncpy(profiles[0].host, "localhost", sizeof(profiles[0].host));
strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));
strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
profiles[0].port = 8021;
......
/* $OpenBSD: getopt.h,v 1.2 2008/06/26 05:42:04 ray Exp $ */
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Dieter Baron and Thomas Klausner.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GETOPT_H_
#define _GETOPT_H_
/*
* GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
*/
#define no_argument 0
#define required_argument 1
#define optional_argument 2
struct option {
/* name of long option */
const char *name;
/*
* one of no_argument, required_argument, and optional_argument:
* whether option takes an argument
*/
int has_arg;
/* if not NULL, set *flag to val when option found */
int *flag;
/* if flag not NULL, value to set *flag to; else return value */
int val;
};
int getopt_long(int, char * const *, const char *,
const struct option *, int *);
int getopt_long_only(int, char * const *, const char *,
const struct option *, int *);
#ifndef _GETOPT_DEFINED_
#define _GETOPT_DEFINED_
int getopt(int, char * const *, const char *);
int getsubopt(char **, char * const *, char **);
extern char *optarg; /* getopt(3) external variables */
extern int opterr;
extern int optind;
extern int optopt;
extern int optreset;
extern char *suboptarg; /* getsubopt(3) external variable */
#endif
#endif /* !_GETOPT_H_ */
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论