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

[patch] ext/Win32/Win32.xs compilation fails on msvc < 6 #9028

Closed
p5pRT opened this issue Sep 17, 2007 · 8 comments
Closed

[patch] ext/Win32/Win32.xs compilation fails on msvc < 6 #9028

p5pRT opened this issue Sep 17, 2007 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 17, 2007

Migrated from rt.perl.org#45493 (status was 'resolved')

Searchable as RT45493$

@p5pRT
Copy link
Author

p5pRT commented Sep 17, 2007

From dk@tetsuo.karasik.eu.org

Created by dk@tetsuo.karasik.eu.org

A patch for smoke, fixes compilation on older msvc versions​:

Inline Patch
--- /home/dk/src/perl-current/ext/Win32/Win32.xs        2007-06-26 11:10:49.000000000 +0200
+++ ./Win32.xs  2007-09-17 10:49:43.000000000 +0200
@@ -43,6 +43,13 @@
 #   define CSIDL_FLAG_CREATE               0x8000
 #endif

+#ifndef CSIDL_COMMON_FAVORITES
+#   define CSIDL_COMMON_FAVORITES     0x001F
+#   define CSIDL_INTERNET_CACHE       0x0020
+#   define CSIDL_COOKIES              0x0021
+#   define CSIDL_HISTORY              0x0022
+#endif
+
 #ifndef CSIDL_ADMINTOOLS
 #   define CSIDL_ADMINTOOLS           0x0030
 #   define CSIDL_COMMON_ADMINTOOLS    0x002F
Perl Info

Flags:
    category=core
    severity=low


Summary of my perl5 (revision 5 version 10 subversion 0 patchlevel 31876) configuration:
  Platform:
    osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -GF -W3 -Od -MD -Zi -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DUTF8_FILENAME_SEMANTICS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-Od -MD -Zi',
    cppflags='-DWIN32'
    ccversion='11.00.7022', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug  -libpath:"c:\usr\local\perl\blead\lib\CORE"  -machine:x86'
    libpth=\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl59.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug  -libpath:"c:\usr\local\perl\blead\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
                        PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO
  Locally applied patches:
	DEVEL
  Built under MSWin32
  Compiled at Sep 17 2007 23:37:43
  %ENV:
  @INC:
    C:/home/src/perl-current/lib
    .

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2007

From @steve-m-hay

How about the attached patch?

This incorporates the #defines apparently required for MSVC < 6, and
tests each one individually and in numerical order. To me it makes more
sense than setting whole groups of #defines based on the #definedness of
CSIDL_COMMON_FAVORITES and CSIDL_ADMINTOOLS, and it makes it easier to
see what's there and what isn't.

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2007

From @steve-m-hay

win32xs.patch
==== //depot/perl/ext/Win32/Win32.xs#5 - c:\p5p\bleadperl\ext\Win32\Win32.xs ====
@@ -39,46 +39,71 @@
 typedef void* (__stdcall *PFNFreeSid)(PSID);
 typedef BOOL (__stdcall *PFNIsUserAnAdmin)();
 
-#ifndef CSIDL_FLAG_CREATE
-#   define CSIDL_FLAG_CREATE               0x8000
+#ifndef CSIDL_MYMUSIC
+#   define CSIDL_MYMUSIC              0x000D
+#endif
+#ifndef CSIDL_MYVIDEO
+#   define CSIDL_MYVIDEO              0x000E
+#endif
+#ifndef CSIDL_LOCAL_APPDATA
+#   define CSIDL_LOCAL_APPDATA        0x001C
+#endif
+#ifndef CSIDL_COMMON_FAVORITES
+#   define CSIDL_COMMON_FAVORITES     0x001F
+#endif
+#ifndef CSIDL_INTERNET_CACHE
+#   define CSIDL_INTERNET_CACHE       0x0020
+#endif
+#ifndef CSIDL_COOKIES
+#   define CSIDL_COOKIES              0x0021
+#endif
+#ifndef CSIDL_HISTORY
+#   define CSIDL_HISTORY              0x0022
 #endif
-
-#ifndef CSIDL_ADMINTOOLS
-#   define CSIDL_ADMINTOOLS           0x0030
-#   define CSIDL_COMMON_ADMINTOOLS    0x002F
+#ifndef CSIDL_COMMON_APPDATA
 #   define CSIDL_COMMON_APPDATA       0x0023
-#   define CSIDL_COMMON_DOCUMENTS     0x002E
-#   define CSIDL_COMMON_TEMPLATES     0x002D
-#   define CSIDL_LOCAL_APPDATA        0x001C
+#endif
+#ifndef CSIDL_WINDOWS
+#   define CSIDL_WINDOWS              0x0024
+#endif
+#ifndef CSIDL_PROGRAM_FILES
+#   define CSIDL_PROGRAM_FILES        0x0026
+#endif
+#ifndef CSIDL_MYPICTURES
 #   define CSIDL_MYPICTURES           0x0027
+#endif
+#ifndef CSIDL_PROFILE
 #   define CSIDL_PROFILE              0x0028
-#   define CSIDL_PROGRAM_FILES        0x0026
+#endif
+#ifndef CSIDL_PROGRAM_FILES_COMMON
 #   define CSIDL_PROGRAM_FILES_COMMON 0x002B
-#   define CSIDL_WINDOWS              0x0024
+#endif
+#ifndef CSIDL_COMMON_TEMPLATES
+#   define CSIDL_COMMON_TEMPLATES     0x002D
+#endif
+#ifndef CSIDL_COMMON_DOCUMENTS
+#   define CSIDL_COMMON_DOCUMENTS     0x002E
+#endif
+#ifndef CSIDL_COMMON_ADMINTOOLS
+#   define CSIDL_COMMON_ADMINTOOLS    0x002F
 #endif
-
-#ifndef CSIDL_CDBURN_AREA
-#   define CSIDL_CDBURN_AREA          0x003B
+#ifndef CSIDL_ADMINTOOLS
+#   define CSIDL_ADMINTOOLS           0x0030
 #endif
-
 #ifndef CSIDL_COMMON_MUSIC
 #   define CSIDL_COMMON_MUSIC         0x0035
 #endif
-
 #ifndef CSIDL_COMMON_PICTURES
 #   define CSIDL_COMMON_PICTURES      0x0036
 #endif
-
 #ifndef CSIDL_COMMON_VIDEO
 #   define CSIDL_COMMON_VIDEO         0x0037
 #endif
-
-#ifndef CSIDL_MYMUSIC
-#   define CSIDL_MYMUSIC              0x000D
+#ifndef CSIDL_CDBURN_AREA
+#   define CSIDL_CDBURN_AREA          0x003B
 #endif
-
-#ifndef CSIDL_MYVIDEO
-#   define CSIDL_MYVIDEO              0x000E
+#ifndef CSIDL_FLAG_CREATE
+#   define CSIDL_FLAG_CREATE          0x8000
 #endif
 
 /* Use explicit struct definition because wSuiteMask and

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2007

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2007

From dk@tetsuo.karasik.eu.org

On Tue, Sep 18, 2007 at 01​:12​:57AM -0700, Steve Hay via RT wrote​:

How about the attached patch?

This incorporates the #defines apparently required for MSVC < 6, and
tests each one individually and in numerical order. To me it makes more
sense than setting whole groups of #defines based on the #definedness of
CSIDL_COMMON_FAVORITES and CSIDL_ADMINTOOLS, and it makes it easier to
see what's there and what isn't.

That's even better, of course.

--
Sincerely,
  Dmitry Karasik

@p5pRT
Copy link
Author

p5pRT commented Sep 19, 2007

From @steve-m-hay

I've now applied the revised patch to bleadperl as #31900 (with a
$VERSION bump). Thanks for the bug report and the patch.

@p5pRT
Copy link
Author

p5pRT commented Sep 19, 2007

From [Unknown Contact. See original ticket]

I've now applied the revised patch to bleadperl as #31900 (with a
$VERSION bump). Thanks for the bug report and the patch.

@p5pRT
Copy link
Author

p5pRT commented Sep 19, 2007

@steve-m-hay - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant