]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add mod_timezone to msvc build
authorMichael Jerris <mike@jerris.com>
Wed, 20 Aug 2008 01:55:43 +0000 (01:55 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 20 Aug 2008 01:55:43 +0000 (01:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9327 d0543943-73ff-0310-b7d9-9358b9ac24b2

Freeswitch.2008.sln
src/mod/applications/mod_timezone/localtime_find.c
src/mod/applications/mod_timezone/mod_timezone.2008.vcproj [new file with mode: 0644]
src/mod/applications/mod_timezone/mod_timezone.c

index d1f301c78df43bd8f538a1b8958278679b0b5cb5..eca2a0fb7c2eed7fd88a7acacfdab83ba8d23dbb 100644 (file)
@@ -966,6 +966,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_zh", "src\mod\say\m
                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_timezone", "src\mod\applications\mod_timezone\mod_timezone.2008.vcproj", "{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -1688,6 +1693,12 @@ Global
                {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32\r
                {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32\r
                {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.Build.0 = Debug|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.ActiveCfg = Release|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.Build.0 = Release|Win32\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|x64.ActiveCfg = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -1717,6 +1728,7 @@ Global
                {65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
                {E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
                {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
+               {5CA0F863-CB0F-4250-A863-A5355BDAE224} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
                {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
                {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
                {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
index 3f25679646e21338381ec28bce9b6d4f7e15b2fa..2bbd2bf268433832753f9ce91262358127e60cd7 100644 (file)
 #endif /* defined __GNUC__ */
 #endif /* !defined lint */
 #endif /* !defined GNUC_or_lint */
+#ifdef WIN32
+#define GNUC_or_lint
+#endif
 
 #ifndef INITIALIZE
 #ifdef GNUC_or_lint
@@ -241,10 +244,9 @@ static const int   year_lengths[2] = {
     character.
 */
 
-static const char *getzname(strp)
-register const char *  strp;
+static const char *getzname(register const char *strp)
 {
-       register char   c;
+       register char c;
 
        while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' &&
                c != '+')
@@ -260,11 +262,7 @@ register const char *      strp;
     Otherwise, return a pointer to the first character not part of the number.
 */
 
-static const char *getnum(strp, nump, min, max)
-       register const char *   strp;
-       int * const             nump;
-       const int               min;
-       const int               max;
+static const char *getnum(register const char *strp, int * const nump, const int min, const int max)
 {
        register char   c;
        register int    num;
@@ -292,9 +290,7 @@ static const char *getnum(strp, nump, min, max)
     of seconds.
 */
 
-static const char *getsecs(strp, secsp)
-       register const char *   strp;
-       long * const            secsp;
+static const char *getsecs(register const char *strp, long * const secsp)
 {
        int     num;
 
@@ -333,9 +329,7 @@ static const char *getsecs(strp, secsp)
     Otherwise, return a pointer to the first character not part of the time.
 */
 
-static const char *getoffset(strp, offsetp)
-       register const char *   strp;
-       long * const            offsetp;
+static const char *getoffset(register const char *strp, long * const offsetp)
 {
        register int    neg = 0;
 
@@ -359,9 +353,7 @@ static const char *getoffset(strp, offsetp)
     Otherwise, return a pointer to the first character not part of the rule.
 */
 
-static const char *getrule(strp, rulep)
-        const char *                   strp;
-       register struct rule * const    rulep;
+static const char *getrule(const char *strp, register struct rule * const rulep)
 {
        if (*strp == 'J') {
                /*
@@ -413,11 +405,7 @@ static const char *getrule(strp, rulep)
     calculate the Epoch-relative time that rule takes effect.
 */
 
-static time_t transtime(janfirst, year, rulep, offset)
-        const time_t                   janfirst;
-       const int                               year;
-        register const struct rule * const     rulep;
-       const long                              offset;
+static time_t transtime(const time_t janfirst, const int year, register const struct rule * const rulep, const long offset)
 {
        register int    leapyear;
        register time_t value;
@@ -509,10 +497,7 @@ static time_t transtime(janfirst, year, rulep, offset)
     appropriate.
 */
 
-static int tzparse(name, sp, lastditch)
-       const char *                    name;
-        register struct state * const  sp;
-        const int                              lastditch;
+static int tzparse(const char *name, register struct state * const sp, const int lastditch)
 {
        const char *                    stdname;
        const char *                    dstname;
@@ -666,7 +651,7 @@ static int tzparse(name, sp, lastditch)
                        */
                        for (i = 0; i < sp->timecnt; ++i) {
                                j = sp->types[i];
-                               sp->types[i] = sp->ttis[j].tt_isdst;
+                               sp->types[i] = (unsigned char)sp->ttis[j].tt_isdst;
                                if (sp->ttis[j].tt_ttisgmt) {
                                        /* No adjustment to transition time */
                                } else {
@@ -737,12 +722,13 @@ static int tzparse(name, sp, lastditch)
 /* **************************************************************************
            
    ************************************************************************** */
+#if (_MSC_VER >= 1400)                 // VC8+\r
+#define switch_assert(expr) assert(expr);__analysis_assume( expr )\r
+#else\r
+#define switch_assert(expr) assert(expr)\r
+#endif\r
 
-static void timesub(timep, offset, sp, tmp)
-        const time_t * const                   timep;
-        const long                                     offset;
-        register const struct state * const            sp;
-        register struct tm * const                     tmp;
+static void timesub(const time_t * const timep, const long offset, register const struct state * const sp, register struct tm * const tmp)
 {
        register const struct lsinfo *  lp;
        register long                   days;
@@ -754,9 +740,9 @@ static void timesub(timep, offset, sp, tmp)
        register int                    hit;
        register int                    i;
 
-       assert(timep != NULL);
-       assert(sp != NULL);
-       assert(tmp != NULL);
+       switch_assert(timep != NULL);
+       switch_assert(sp != NULL);
+       switch_assert(tmp != NULL);
 
        corr = 0;
        hit = 0;
@@ -782,7 +768,7 @@ static void timesub(timep, offset, sp, tmp)
                        break;
                }
        }
-       days = *timep / SECSPERDAY;
+       days = (long)(*timep / SECSPERDAY);
        rem = *timep % SECSPERDAY;
 
 
@@ -846,17 +832,16 @@ static void timesub(timep, offset, sp, tmp)
 
        tmp->tm_mday = (int) (days + 1);
        tmp->tm_isdst = 0;
+#ifndef WIN32
        tmp->tm_gmtoff = offset;
+#endif
 }
 
 /* **************************************************************************
            
    ************************************************************************** */
 
-void tztime( timep, tzstring, tmp )
-        const time_t * const           timep;
-        const char                     *tzstring;
-        struct tm * const              tmp;
+void tztime(const time_t * const timep, const char *tzstring, struct tm * const tmp )
 {
        struct state                    *tzptr, 
                                        *sp;
@@ -903,7 +888,9 @@ void tztime( timep, tzstring, tmp )
                {
                        timesub( &t, ttisp->tt_gmtoff, sp, tmp);
                        tmp->tm_isdst = ttisp->tt_isdst;
+#ifndef WIN32
                        tmp->tm_zone = &sp->chars[ttisp->tt_abbrind];
+#endif
                }
 
                free(tzptr);
diff --git a/src/mod/applications/mod_timezone/mod_timezone.2008.vcproj b/src/mod/applications/mod_timezone/mod_timezone.2008.vcproj
new file mode 100644 (file)
index 0000000..8c39c4d
--- /dev/null
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="mod_timezone"\r
+       ProjectGUID="{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
+       RootNamespace="mod_timezone"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="131072"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       ConfigurationType="2"\r
+                       InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
+                               UsePrecompiledHeader="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       ConfigurationType="2"\r
+                       InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
+                               UsePrecompiledHeader="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <File\r
+                       RelativePath=".\localtime_find.c"\r
+                       >\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       DisableSpecificWarnings="6385"\r
+                               />\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       DisableSpecificWarnings="6385"\r
+                               />\r
+                       </FileConfiguration>\r
+               </File>\r
+               <File\r
+                       RelativePath=".\mod_timezone.c"\r
+                       >\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 287f23234c17523d4ea83d4471f35737c16adf2d..cf0f00f8727df49b22e2ca1d45c45ae03f25f2e0 100644 (file)
@@ -34,9 +34,7 @@
    and use switch_* functions for the output.
 */
 
-static void tm2switchtime( tm, xt ) 
-       struct tm               *tm;
-switch_time_exp_t      *xt;
+static void tm2switchtime(struct tm * tm, switch_time_exp_t *xt ) 
 {
 
        if (!xt || !tm) {
@@ -53,7 +51,9 @@ switch_time_exp_t     *xt;
        xt->tm_wday     = tm->tm_wday;
        xt->tm_yday     = tm->tm_yday;
        xt->tm_isdst    = tm->tm_isdst;
+#ifndef WIN32
        xt->tm_gmtoff   = tm->tm_gmtoff;
+#endif
 
        return;
 }
@@ -70,12 +70,12 @@ typedef struct {
 static switch_timezones_list_t TIMEZONES_LIST = { 0 };
 static switch_event_node_t *NODE = NULL;
 
-const char *switch_lookup_timezone( const char *tzname )
+const char *switch_lookup_timezone( const char *tz_name )
 {
        char *value = NULL;
 
-       if ( tzname && (value = switch_core_hash_find(TIMEZONES_LIST.hash, tzname))==NULL ) {
-           switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timezone '%s' not found!\n", tzname);
+       if ( tz_name && (value = switch_core_hash_find(TIMEZONES_LIST.hash, tz_name))==NULL ) {
+           switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timezone '%s' not found!\n", tz_name);
        }
        
        return value;
@@ -135,7 +135,7 @@ SWITCH_STANDARD_API(strftime_tz_api_function)
        time_t timep;
 
        char *format = NULL;
-       const char *tzname;
+       const char *tz_name;
        const char *tzdef;
 
        switch_size_t retsize;
@@ -150,15 +150,15 @@ SWITCH_STANDARD_API(strftime_tz_api_function)
 
        if (!switch_strlen_zero(cmd)) {
                format = strchr(cmd, ' ');
-               tzname = cmd;
+               tz_name = cmd;
                if (format) {
                        *format++ = '\0';
                }
 
-               tzdef = switch_lookup_timezone( tzname );
+               tzdef = switch_lookup_timezone( tz_name );
        } else {
                /* We set the default timezone to GMT. */
-               tzname="GMT";
+               tz_name="GMT";
                tzdef="GMT";
        }