Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable exchange module for all builds #1236

Merged
merged 3 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions com/win32comext/mapi/emsabtags.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Converted "manually" from EMSABTAG.H
from mapitags import PT_UNSPECIFIED, PT_NULL, PT_I2, PT_LONG, PT_R4, \
PT_DOUBLE, PT_CURRENCY, PT_APPTIME, PT_ERROR, \
PT_BOOLEAN, PT_OBJECT, PT_I8, PT_STRING8, PT_UNICODE, \
PT_SYSTIME, PT_CLSID, PT_BINARY, PT_SHORT, PT_I4, \
PT_FLOAT, PT_DOUBLE, PT_LONGLONG, PT_TSTRING, \
PT_MV_I2, PT_MV_LONG, PT_MV_R4, PT_MV_DOUBLE, \
PT_MV_CURRENCY, PT_MV_APPTIME, PT_MV_SYSTIME, \
PT_MV_STRING8, PT_MV_BINARY, PT_MV_UNICODE, \
PT_MV_CLSID, PT_MV_I8, PT_MV_SHORT, PT_MV_I4, \
PT_MV_FLOAT, PT_MV_R8, PT_MV_LONGLONG, PT_MV_TSTRING, \
PROP_TAG
from .mapitags import PT_UNSPECIFIED, PT_NULL, PT_I2, PT_LONG, PT_R4, \
PT_DOUBLE, PT_CURRENCY, PT_APPTIME, PT_ERROR, \
PT_BOOLEAN, PT_OBJECT, PT_I8, PT_STRING8, PT_UNICODE, \
PT_SYSTIME, PT_CLSID, PT_BINARY, PT_SHORT, PT_I4, \
PT_FLOAT, PT_DOUBLE, PT_LONGLONG, PT_TSTRING, \
PT_MV_I2, PT_MV_LONG, PT_MV_R4, PT_MV_DOUBLE, \
PT_MV_CURRENCY, PT_MV_APPTIME, PT_MV_SYSTIME, \
PT_MV_STRING8, PT_MV_BINARY, PT_MV_UNICODE, \
PT_MV_CLSID, PT_MV_I8, PT_MV_SHORT, PT_MV_I4, \
PT_MV_FLOAT, PT_MV_R8, PT_MV_LONGLONG, PT_MV_TSTRING, \
PROP_TAG


AB_SHOW_PHANTOMS = 2
Expand Down
2 changes: 1 addition & 1 deletion com/win32comext/mapi/mapiutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
IntType=int
from pywintypes import TimeType
import pythoncom
import mapi, mapitags
from . import mapi, mapitags

prTable = {}
def GetPropTagName(pt):
Expand Down
4 changes: 4 additions & 0 deletions com/win32comext/mapi/src/exchange.i
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ HRESULT MyHrMailboxLogon(
OUT LPMDB *lppMailboxMDB) // ptr to mailbox message store ptr
{
#if defined(DONT_HAVE_MBLOGON)
PyGILState_STATE gstate = PyGILState_Ensure();
PyErr_Warn(PyExc_RuntimeWarning, "Not available with this version of the Exchange SDK");
PyGILState_Release(gstate);
return E_NOTIMPL;
#else
return HrMailboxLogon(lplhSession, lpMDB, lpszMsgStoreDN, lpszMailboxDN, lppMailboxMDB);
Expand All @@ -467,7 +469,9 @@ HRESULT MyHrMailboxLogon(
HRESULT MyHrMailboxLogoff(IMsgStore **pp)
{
#if defined(DONT_HAVE_MBLOGON)
PyGILState_STATE gstate = PyGILState_Ensure();
PyErr_Warn(PyExc_RuntimeWarning, "Not available with this version of the Exchange SDK");
PyGILState_Release(gstate);
return E_NOTIMPL;
#else
return HrMailboxLogoff(pp);
Expand Down
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,13 @@ def _why_cant_build_extension(self, ext):
# Exclude exchange 32-bit utility libraries from 64-bit
# builds. Note that the exchange module now builds, but only
# includes interfaces for 64-bit builds.
if self.plat_name == 'win-amd64' and ext.name in ['exchdapi', 'exchange']:
if self.plat_name == 'win-amd64' and ext.name == 'exchdapi':
return "No 64-bit library for utility functions available."
if get_build_version() >=14 and ext.name in ['exchdapi', 'exchange']:
return "Haven't worked out how to make exchange modules build on vs2015"
if get_build_version() >=14:
if ext.name == 'exchange':
ext.libraries.append('legacy_stdio_definitions')
elif ext.name == 'exchdapi':
return "Haven't worked out how to build on vs2015"
include_dirs = self.compiler.include_dirs + \
os.environ.get("INCLUDE", "").split(os.pathsep)
if self.windows_h_version is None:
Expand Down Expand Up @@ -1269,6 +1272,11 @@ def swig_sources(self, sources, ext=None):
fqsource = os.path.abspath(source)
fqtarget = os.path.abspath(target)
rebuild = self.force or (ext and newer_group(ext.swig_deps + [fqsource], fqtarget))

# can remove once edklib is no longer used for 32-bit builds
if source == "com/win32comext/mapi/src/exchange.i":
rebuild = True

log.debug("should swig %s->%s=%s", source, target, rebuild)
if rebuild:
swig_cmd.extend(["-o", fqtarget, fqsource])
Expand Down Expand Up @@ -1839,11 +1847,13 @@ def copy_file(self, src, dest):
%(mapi)s/mapiguids.cpp
""" % dirs).split()),
WinExt_win32com_mapi('exchange', libraries="mapi32",
include_dirs=["%(mapi)s/mapi_headers" % dirs],
sources=("""
%(mapi)s/exchange.i %(mapi)s/exchange.cpp
%(mapi)s/PyIExchangeManageStore.i %(mapi)s/PyIExchangeManageStore.cpp
%(mapi)s/PyIExchangeManageStoreEx.i %(mapi)s/PyIExchangeManageStoreEx.cpp
%(mapi)s/mapiutil.cpp
%(mapi)s/mapiguids.cpp
""" % dirs).split()),
WinExt_win32com_mapi('exchdapi', libraries="mapi32",
sources=("""
Expand Down