This commit is contained in:
Kovid Goyal 2011-07-29 01:19:58 -06:00
parent 6cdebf93f1
commit 6fd23c7ca1
3 changed files with 10 additions and 3 deletions

View File

@ -373,7 +373,7 @@ class Win32Freeze(Command, WixMixIn):
src = self.j(self.src_root, 'setup', 'installer', 'windows',
'portable.c')
obj = self.j(self.obj_dir, self.b(src)+'.obj')
cflags = '/c /EHsc /MT /W3 /Ox /nologo /D_UNICODE'.split()
cflags = '/c /EHsc /MT /W3 /Ox /nologo /D_UNICODE /DUNICODE'.split()
if self.newer(obj, [src]):
self.info('Compiling', obj)

View File

@ -2,8 +2,14 @@
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#include <windows.h>
#include <tchar.h>
#include <wchar.h>
#include <stdio.h>
#define BUFSIZE 4096
@ -32,7 +38,7 @@ void show_last_error_crt(LPCTSTR preamble) {
int err = 0;
_get_errno(&err);
_wcserror_s(buf, BUFSIZE, err);
_tcserror_s(buf, BUFSIZE, err);
show_detailed_error(preamble, buf, err);
}

View File

@ -544,7 +544,8 @@ class MobiWriter(object):
'''
Write the PalmDB header
'''
title = ascii_filename(unicode(self.oeb.metadata.title[0]))
title = ascii_filename(unicode(self.oeb.metadata.title[0])).replace(
' ', '_')
title = title + (b'\0' * (32 - len(title)))
now = int(time.time())
nrecords = len(self.records)