Browse Source

merged in default

ENGINE-781
parent
commit
d4b9895033
8 changed files with 31 additions and 25 deletions
  1. +4
    -8
      build-windows/libpEpasn1/libpEpasn1.vcxproj
  2. +1
    -1
      src/Makefile
  3. +6
    -0
      src/etpan_mime.c
  4. +1
    -1
      src/pEpEngine.h
  5. +1
    -0
      src/platform_windows.cpp
  6. +14
    -8
      src/timestamp.c
  7. +2
    -2
      src/timestamp.h
  8. +2
    -5
      test/Makefile

+ 4
- 8
build-windows/libpEpasn1/libpEpasn1.vcxproj View File

@ -60,10 +60,6 @@
<Link>
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>cd "$(ProjectDir)..\.." &amp;&amp; "$(ProjectDir)..\generate_code.cmd"</Command>
<Message>Generating Code for pEp Sync</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -81,10 +77,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>cd "$(ProjectDir)..\.." &amp;&amp; "$(ProjectDir)..\generate_code.cmd"</Command>
<Message>Generating Code for pEp Sync</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
@ -227,4 +219,8 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<Target Name="BeforeRebuild">
<Message Text="Generating Code for pEp Sync" />
<Exec Command="CD &quot;$(ProjectDir)..\..&quot; &amp;&amp; &quot;$(ProjectDir)..\generate_code.cmd&quot;" />
</Target>
</Project>

+ 1
- 1
src/Makefile View File

@ -28,7 +28,7 @@ endif
ifeq ($(BUILD_ON),Darwin)
ifeq ($(BUILD_FOR),Darwin)
CFLAGS+= -DSQLITE_THREADSAFE=1
LDLIBS+= -lz -liconv
LDLIBS+= -lz -liconv -mmacosx-version-min=10.10
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif


+ 6
- 0
src/etpan_mime.c View File

@ -548,6 +548,12 @@ timestamp * etpantime_to_timestamp(const struct mailimf_date_time *et)
result->tm_mon = et->dt_month - 1;
result->tm_year = et->dt_year - 1900;
result->tm_gmtoff = 36L * (long) et->dt_zone;
// Normalize to UTC and then forget the offset.
time_t t = timegm_with_gmtoff(result);
gmtime_r(&t, result);
result->tm_gmtoff = 0;
return result;
}


+ 1
- 1
src/pEpEngine.h View File

@ -25,7 +25,7 @@ extern "C" {
#define PEP_ENGINE_VERSION_MAJOR 2
#define PEP_ENGINE_VERSION_MINOR 1
#define PEP_ENGINE_VERSION_PATCH 0
#define PEP_ENGINE_VERSION_RC 23
#define PEP_ENGINE_VERSION_RC 25
#define PEP_OWN_USERID "pEp_own_userId"


+ 1
- 0
src/platform_windows.cpp View File

@ -406,6 +406,7 @@ DYNAMIC_API time_t timegm(timestamp *timeptr)
if (!timeptr)
return -1;
timeptr->tm_gmtoff = 0;
time_t result = _mkgmtime((struct tm *) timeptr);
if (result == -1)
return -1;


+ 14
- 8
src/timestamp.c View File

@ -10,12 +10,21 @@
#include <assert.h>
DYNAMIC_API time_t timegm_with_gmtoff(timestamp* ts)
DYNAMIC_API time_t timegm_with_gmtoff(const timestamp* ts)
{
const time_t raw_time = timegm(ts);
if (!ts)
return -1;
timestamp *_ts = timestamp_dup(ts);
if (!_ts)
return -1;
const time_t raw_time = timegm(_ts);
if(raw_time==-1)
return -1;
free_timestamp(_ts);
return raw_time - ts->tm_gmtoff;
}
@ -44,11 +53,8 @@ DYNAMIC_API timestamp * timestamp_dup(const timestamp *src)
if (!src)
return NULL;
timestamp *dst = calloc(1, sizeof(timestamp));
assert(dst);
if (!dst)
return NULL;
timestamp *dst = (timestamp *) malloc(sizeof(timestamp));
memcpy(dst, src, sizeof(timestamp));
return dst;
}

+ 2
- 2
src/timestamp.h View File

@ -34,11 +34,11 @@ typedef struct tm timestamp;
// timegm_with_gmtoff() - convert the broken-out time into time_t, and respect tm_gmtoff
//
// parameters:
// timeptr(inout) broken-out time; members will be "normalized" by this function.
// timeptr(in) broken-out time
//
// return value:
// time_t that holds the usual "seconds since epoch"
DYNAMIC_API time_t timegm_with_gmtoff(timestamp* ts);
DYNAMIC_API time_t timegm_with_gmtoff(const timestamp* ts);
// new_timestamp() - allocate a new timestamp


+ 2
- 5
test/Makefile View File

@ -16,7 +16,7 @@ SRCS:=$(wildcard src/*.cc) $(wildcard src/*/*.cc)
OBJS:=$(addsuffix .o,$(basename $(SRCS)))
DEPS:=$(OBJS:.o=.d)
LDFLAGS+= -L../asn.1 -L../src $(ETPAN_LIB) $(CPPUNIT_LIB)
LDFLAGS+= -L../asn.1 -L../src $(ETPAN_LIB) $(GTEST_LDFLAGS)
TARGET:=EngineTests
@ -63,7 +63,7 @@ endif
CXXFLAGS:=-I$(GTEST_INC_DIR) $(filter-out -DNDEBUG,$(CXXFLAGS))
# FIXME Possibly missing incdirs: ASN1C_INC
CXXFLAGS+= -I./src -I../sync $(CPPUNIT_INC) $(INC_FLAGS) -Wno-deprecated -Wno-unused-variable
CXXFLAGS+= -I./src -I../sync $(INC_FLAGS) -Wno-deprecated -Wno-unused-variable
ifeq ($(OPENPGP),GPG)
CXXFLAGS+= -DUSE_GPG $(GPGME_INC)
@ -81,9 +81,6 @@ endif
ifdef NETPGP_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(NETPGP_LIB)):
endif
ifdef CPPUNIT_LIB
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(CPPUNIT_LIB)):
endif
# Remove trailing ':'
EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS::=)


Loading…
Cancel
Save