2 * Routines to report version information for stuff used by Wireshark
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include <zlib.h> /* to get the libz version number */
38 #ifdef HAVE_SYS_UTSNAME_H
39 #include <sys/utsname.h>
42 #include "version_info.h"
43 #include "capture-pcap-util.h"
44 #include <wsutil/unicode-utils.h>
46 #include "svnversion.h"
52 #ifdef HAVE_OS_X_FRAMEWORKS
53 #include <CoreFoundation/CoreFoundation.h>
58 # include <sys/capability.h>
62 const char *wireshark_svnversion
= " (" SVNVERSION
" from " SVNPATH
")";
64 const char *wireshark_svnversion
= "";
68 * If the string doesn't end with a newline, append one.
69 * Then word-wrap it to 80 columns.
72 end_string(GString
*str
)
78 if (point
== 0 || str
->str
[point
- 1] != '\n')
79 g_string_append(str
, "\n");
85 * Break at or before this point.
88 while (q
> p
&& *q
!= ' ')
98 * Get various library compile-time versions and append them to
99 * the specified GString.
101 * "additional_info" is called at the end to append any additional
102 * information; this is required in order to, for example, put the
103 * Portaudio information at the end of the string, as we currently
104 * don't use Portaudio in TShark.
107 get_compiled_version_info(GString
*str
, void (*prepend_info
)(GString
*),
108 void (*append_info
)(GString
*))
110 if (sizeof(str
) == 4)
111 g_string_append(str
, "(32-bit) ");
113 g_string_append(str
, "(64-bit) ");
116 (*prepend_info
)(str
);
119 g_string_append(str
, "with ");
120 g_string_append_printf(str
,
121 #ifdef GLIB_MAJOR_VERSION
122 "GLib %d.%d.%d", GLIB_MAJOR_VERSION
, GLIB_MINOR_VERSION
,
125 "GLib (version unknown)");
129 g_string_append(str
, ", ");
130 get_compiled_pcap_version(str
);
133 g_string_append(str
, ", ");
135 g_string_append(str
, "with libz ");
137 g_string_append(str
, ZLIB_VERSION
);
138 #else /* ZLIB_VERSION */
139 g_string_append(str
, "(version unknown)");
140 #endif /* ZLIB_VERSION */
141 #else /* HAVE_LIBZ */
142 g_string_append(str
, "without libz");
143 #endif /* HAVE_LIBZ */
146 /* This is UN*X-only. */
148 g_string_append(str
, ", ");
150 g_string_append(str
, "with POSIX capabilities");
151 #ifdef _LINUX_CAPABILITY_VERSION
152 g_string_append(str
, " (Linux)");
153 #endif /* _LINUX_CAPABILITY_VERSION */
154 #else /* HAVE_LIBCAP */
155 g_string_append(str
, "without POSIX capabilities");
156 #endif /* HAVE_LIBCAP */
160 /* This is a Linux-specific library. */
162 g_string_append(str
, ", ");
163 #if defined(HAVE_LIBNL1)
164 g_string_append(str
, "with libnl 1");
165 #elif defined(HAVE_LIBNL2)
166 g_string_append(str
, "with libnl 2");
167 #elif defined(HAVE_LIBNL3)
168 g_string_append(str
, "with libnl 3");
170 g_string_append(str
, "without libnl");
171 #endif /* libnl version */
172 #endif /* __linux__ */
174 /* Additional application-dependent information */
177 g_string_append(str
, ".");
183 typedef void (WINAPI
*nativesi_func_ptr
)(LPSYSTEM_INFO
);
187 * Handles the rather elaborate process of getting OS version information
188 * from OS X (we want the OS X version, not the Darwin version, the latter
189 * being easy to get with uname()).
191 #ifdef HAVE_OS_X_FRAMEWORKS
194 * Fetch a string, as a UTF-8 C string, from a dictionary, given a key.
197 get_string_from_dictionary(CFPropertyListRef dict
, CFStringRef key
)
199 CFStringRef cfstring
;
201 cfstring
= (CFStringRef
)CFDictionaryGetValue((CFDictionaryRef
)dict
,
203 if (cfstring
== NULL
)
205 if (CFGetTypeID(cfstring
) != CFStringGetTypeID()) {
206 /* It isn't a string. Punt. */
209 return CFString_to_C_string(cfstring
);
213 * Get the OS X version information, and append it to the GString.
214 * Return TRUE if we succeed, FALSE if we fail.
217 get_os_x_version_info(GString
*str
)
219 static const UInt8 server_version_plist_path
[] =
220 "/System/Library/CoreServices/ServerVersion.plist";
221 static const UInt8 system_version_plist_path
[] =
222 "/System/Library/CoreServices/SystemVersion.plist";
223 CFURLRef version_plist_file_url
;
224 CFReadStreamRef version_plist_stream
;
225 CFDictionaryRef version_dict
;
229 * On OS X, report the OS X version number as the OS, and put
230 * the Darwin information in parentheses.
232 * Alas, Gestalt() is deprecated in Mountain Lion, so the build
233 * fails if you treat deprecation warnings as fatal. I don't
234 * know of any replacement API, so we fall back on reading
235 * /System/Library/CoreServices/ServerVersion.plist if it
236 * exists, otherwise /System/Library/CoreServices/SystemVersion.plist,
237 * and using ProductUserVisibleVersion. We also get the build
238 * version from ProductBuildVersion and the product name from
241 version_plist_file_url
= CFURLCreateFromFileSystemRepresentation(NULL
,
242 server_version_plist_path
, sizeof server_version_plist_path
- 1,
244 if (version_plist_file_url
== NULL
)
246 version_plist_stream
= CFReadStreamCreateWithFile(NULL
,
247 version_plist_file_url
);
248 CFRelease(version_plist_file_url
);
249 if (version_plist_stream
== NULL
)
251 if (!CFReadStreamOpen(version_plist_stream
)) {
252 CFRelease(version_plist_stream
);
255 * Try SystemVersion.plist.
257 version_plist_file_url
= CFURLCreateFromFileSystemRepresentation(NULL
,
258 system_version_plist_path
, sizeof system_version_plist_path
- 1,
260 if (version_plist_file_url
== NULL
)
262 version_plist_stream
= CFReadStreamCreateWithFile(NULL
,
263 version_plist_file_url
);
264 CFRelease(version_plist_file_url
);
265 if (version_plist_stream
== NULL
)
267 if (!CFReadStreamOpen(version_plist_stream
)) {
268 CFRelease(version_plist_stream
);
272 #ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM
273 version_dict
= (CFDictionaryRef
)CFPropertyListCreateWithStream(NULL
,
274 version_plist_stream
, 0, kCFPropertyListImmutable
,
277 version_dict
= (CFDictionaryRef
)CFPropertyListCreateFromStream(NULL
,
278 version_plist_stream
, 0, kCFPropertyListImmutable
,
281 if (version_dict
== NULL
) {
282 CFRelease(version_plist_stream
);
285 if (CFGetTypeID(version_dict
) != CFDictionaryGetTypeID()) {
286 /* This is *supposed* to be a dictionary. Punt. */
287 CFRelease(version_dict
);
288 CFReadStreamClose(version_plist_stream
);
289 CFRelease(version_plist_stream
);
292 /* Get the product name string. */
293 string
= get_string_from_dictionary(version_dict
,
294 CFSTR("ProductName"));
295 if (string
== NULL
) {
296 CFRelease(version_dict
);
297 CFReadStreamClose(version_plist_stream
);
298 CFRelease(version_plist_stream
);
301 g_string_append_printf(str
, "%s", string
);
304 /* Get the OS version string. */
305 string
= get_string_from_dictionary(version_dict
,
306 CFSTR("ProductUserVisibleVersion"));
307 if (string
== NULL
) {
308 CFRelease(version_dict
);
309 CFReadStreamClose(version_plist_stream
);
310 CFRelease(version_plist_stream
);
313 g_string_append_printf(str
, " %s", string
);
316 /* Get the build string */
317 string
= get_string_from_dictionary(version_dict
,
318 CFSTR("ProductBuildVersion"));
319 if (string
== NULL
) {
320 CFRelease(version_dict
);
321 CFReadStreamClose(version_plist_stream
);
322 CFRelease(version_plist_stream
);
325 g_string_append_printf(str
, ", build %s", string
);
327 CFRelease(version_dict
);
328 CFReadStreamClose(version_plist_stream
);
329 CFRelease(version_plist_stream
);
335 * Get the OS version, and append it to the GString
337 void get_os_version_info(GString
*str
)
340 OSVERSIONINFOEX info
;
341 SYSTEM_INFO system_info
;
342 nativesi_func_ptr nativesi_func
;
343 #elif defined(HAVE_SYS_UTSNAME_H)
351 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
353 * for more than you ever wanted to know about determining the
354 * flavor of Windows on which you're running. Implementing more
355 * of that is left as an exercise to the reader - who should
356 * check any copyright information about code samples on MSDN
357 * before cutting and pasting into Wireshark.
359 * They should also note that you need an OSVERSIONINFOEX structure
360 * to get some of that information, and that not only is that
361 * structure not supported on older versions of Windows, you might
362 * not even be able to compile code that *uses* that structure with
363 * older versions of the SDK.
366 memset(&info
, '\0', sizeof info
);
367 info
.dwOSVersionInfoSize
= sizeof info
;
368 if (!GetVersionEx((OSVERSIONINFO
*)&info
)) {
370 * XXX - get the failure reason.
372 g_string_append(str
, "unknown Windows version");
376 memset(&system_info
, '\0', sizeof system_info
);
377 /* Look for and use the GetNativeSystemInfo() function if available to get the correct processor
378 * architecture even when running 32-bit Wireshark in WOW64 (x86 emulation on 64-bit Windows) */
379 nativesi_func
= (nativesi_func_ptr
)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetNativeSystemInfo");
381 nativesi_func(&system_info
);
383 GetSystemInfo(&system_info
);
385 switch (info
.dwPlatformId
) {
387 case VER_PLATFORM_WIN32s
:
389 g_string_append_printf(str
, "Windows 3.1 with Win32s");
392 case VER_PLATFORM_WIN32_WINDOWS
:
394 switch (info
.dwMajorVersion
) {
397 /* 3 cheers for Microsoft marketing! */
398 switch (info
.dwMinorVersion
) {
401 g_string_append_printf(str
, "Windows 95");
405 g_string_append_printf(str
, "Windows 98");
409 g_string_append_printf(str
, "Windows Me");
413 g_string_append_printf(str
, "Windows OT, unknown version %lu.%lu",
414 info
.dwMajorVersion
, info
.dwMinorVersion
);
420 g_string_append_printf(str
, "Windows OT, unknown version %lu.%lu",
421 info
.dwMajorVersion
, info
.dwMinorVersion
);
426 case VER_PLATFORM_WIN32_NT
:
428 switch (info
.dwMajorVersion
) {
432 g_string_append_printf(str
, "Windows NT %lu.%lu",
433 info
.dwMajorVersion
, info
.dwMinorVersion
);
437 /* 3 cheers for Microsoft marketing! */
438 switch (info
.dwMinorVersion
) {
441 g_string_append_printf(str
, "Windows 2000");
445 g_string_append_printf(str
, "Windows XP");
449 if ((info
.wProductType
== VER_NT_WORKSTATION
) &&
450 (system_info
.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
)) {
451 g_string_append_printf(str
, "Windows XP Professional x64 Edition");
453 g_string_append_printf(str
, "Windows Server 2003");
454 if (system_info
.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
)
455 g_string_append_printf(str
, " x64 Edition");
460 g_string_append_printf(str
, "Windows NT, unknown version %lu.%lu",
461 info
.dwMajorVersion
, info
.dwMinorVersion
);
467 gboolean is_nt_workstation
;
469 if (system_info
.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_AMD64
)
470 g_string_append(str
, "64-bit ");
471 else if (system_info
.wProcessorArchitecture
== PROCESSOR_ARCHITECTURE_INTEL
)
472 g_string_append(str
, "32-bit ");
473 #ifndef VER_NT_WORKSTATION
474 #define VER_NT_WORKSTATION 0x01
475 is_nt_workstation
= ((info
.wReserved
[1] & 0xff) == VER_NT_WORKSTATION
);
477 is_nt_workstation
= (info
.wProductType
== VER_NT_WORKSTATION
);
479 switch (info
.dwMinorVersion
) {
481 g_string_append_printf(str
, is_nt_workstation
? "Windows Vista" : "Windows Server 2008");
484 g_string_append_printf(str
, is_nt_workstation
? "Windows 7" : "Windows Server 2008 R2");
487 g_string_append_printf(str
, is_nt_workstation
? "Windows 8" : "Windows Server 2012");
490 g_string_append_printf(str
, is_nt_workstation
? "Windows 8.1" : "Windows Server 2012 R2");
493 g_string_append_printf(str
, "Windows NT, unknown version %lu.%lu",
494 info
.dwMajorVersion
, info
.dwMinorVersion
);
500 g_string_append_printf(str
, "Windows NT, unknown version %lu.%lu",
501 info
.dwMajorVersion
, info
.dwMinorVersion
);
503 } /* info.dwMajorVersion */
507 g_string_append_printf(str
, "Unknown Windows platform %lu version %lu.%lu",
508 info
.dwPlatformId
, info
.dwMajorVersion
, info
.dwMinorVersion
);
511 if (info
.szCSDVersion
[0] != '\0')
512 g_string_append_printf(str
, " %s", utf_16to8(info
.szCSDVersion
));
513 g_string_append_printf(str
, ", build %lu", info
.dwBuildNumber
);
514 #elif defined(HAVE_SYS_UTSNAME_H)
516 * We have <sys/utsname.h>, so we assume we have "uname()".
518 if (uname(&name
) < 0) {
519 g_string_append_printf(str
, "unknown OS version (uname failed - %s)",
524 if (strcmp(name
.sysname
, "AIX") == 0) {
526 * Yay, IBM! Thanks for doing something different
527 * from most of the other UNIXes out there, and
528 * making "name.version" apparently be the major
529 * version number and "name.release" be the minor
532 g_string_append_printf(str
, "%s %s.%s", name
.sysname
, name
.version
,
536 * XXX - get "version" on any other platforms?
538 * On Digital/Tru64 UNIX, it's something unknown.
539 * On Solaris, it's some kind of build information.
540 * On HP-UX, it appears to be some sort of subrevision
542 * On *BSD and Darwin/OS X, it's a long string giving
543 * a build date, config file name, etc., etc., etc..
545 #ifdef HAVE_OS_X_FRAMEWORKS
547 * On Mac OS X, report the Mac OS X version number as
548 * the OS version if we can, and put the Darwin information
551 if (get_os_x_version_info(str
)) {
552 /* Success - append the Darwin information. */
553 g_string_append_printf(str
, " (%s %s)", name
.sysname
, name
.release
);
555 /* Failure - just use the Darwin information. */
556 g_string_append_printf(str
, "%s %s", name
.sysname
, name
.release
);
558 #else /* HAVE_OS_X_FRAMEWORKS */
560 * XXX - on Linux, are there any APIs to get the distribution
561 * name and version number? I think some distributions have
564 * At least on Linux Standard Base-compliant distributions,
565 * there's an "lsb_release" command. However:
567 * http://forums.fedoraforum.org/showthread.php?t=220885
569 * seems to suggest that if you don't have the redhat-lsb
570 * package installed, you don't have lsb_release, and that
571 * /etc/fedora-release has the release information on
574 * http://linux.die.net/man/1/lsb_release
576 * suggests that there's an /etc/distrib-release file, but
577 * it doesn't indicate whether "distrib" is literally
578 * "distrib" or is the name for the distribution, and
579 * also speaks of an /etc/debian_version file.
581 * "lsb_release" apparently parses /etc/lsb-release, which
582 * has shell-style assignments, assigning to, among other
583 * values, DISTRIB_ID (distributor/distribution name),
584 * DISTRIB_RELEASE (release number of the distribution),
585 * DISTRIB_DESCRIPTION (*might* be name followed by version,
586 * but the manpage for lsb_release seems to indicate that's
587 * not guaranteed), and DISTRIB_CODENAME (code name, e.g.
588 * "licentious" for the Ubuntu Licentious Lemur release).
589 * the lsb_release man page also speaks of the distrib-release
590 * file, but Debian doesn't have one, and Ubuntu 7's
591 * lsb_release command doesn't look for one.
593 * I've seen references to /etc/redhat-release as well.
595 * At least on my Ubuntu 7 system, /etc/debian_version
596 * doesn't contain anything interesting (just some Debian
601 * http://bugs.python.org/issue1322
603 * http://www.novell.com/coolsolutions/feature/11251.html
605 * http://linuxmafia.com/faq/Admin/release-files.html
607 * and the Lib/Platform.py file in recent Python 2.x
610 g_string_append_printf(str
, "%s %s", name
.sysname
, name
.release
);
611 #endif /* HAVE_OS_X_FRAMEWORKS */
614 g_string_append(str
, "an unknown OS");
620 * Get the CPU info, and append it to the GString
623 #if defined(_MSC_VER)
625 do_cpuid(int *CPUInfo
, guint32 selector
){
626 __cpuid(CPUInfo
, selector
);
628 #elif defined(__GNUC__)
629 #if defined(__x86_64__)
631 do_cpuid(guint32
*CPUInfo
, int selector
)
633 __asm__
__volatile__("cpuid"
640 #else /* (__i386__) */
641 /* would need a test if older proccesors have the cpuid instruction */
643 do_cpuid(guint32
*CPUInfo
, int selector _U_
){
647 #endif /* defined(__x86_64__)*/
648 #else /* Other compilers */
650 do_cpuid(guint32
*CPUInfo
, int selector _U_
){
656 * Get CPU info on platforms where the cpuid instruction can be used skip 32 bit versions for GCC
657 * http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/processor-identification-cpuid-instruction-note.pdf
658 * the get_cpuid() routine will return 0 in CPUInfo[0] if cpuinfo isn't available.
661 static void get_cpu_info(GString
*str _U_
)
663 #if defined(_MSC_VER)
668 char CPUBrandString
[0x40];
671 /* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */
673 /* Calling __cpuid with 0x80000000 as the InfoType argument*/
674 /* gets the number of valid extended IDs.*/
675 do_cpuid(CPUInfo
, 0x80000000);
678 if( nExIds
<0x80000005)
680 memset(CPUBrandString
, 0, sizeof(CPUBrandString
));
682 /* Interpret CPU brand string.*/
683 do_cpuid(CPUInfo
, 0x80000002);
684 memcpy(CPUBrandString
, CPUInfo
, sizeof(CPUInfo
));
685 do_cpuid(CPUInfo
, 0x80000003);
686 memcpy(CPUBrandString
+ 16, CPUInfo
, sizeof(CPUInfo
));
687 do_cpuid(CPUInfo
, 0x80000004);
688 memcpy(CPUBrandString
+ 32, CPUInfo
, sizeof(CPUInfo
));
690 g_string_append_printf(str
, "\n%s", CPUBrandString
);
694 static void get_mem_info(GString
*str _U_
)
697 MEMORYSTATUSEX statex
;
699 statex
.dwLength
= sizeof (statex
);
701 if(GlobalMemoryStatusEx (&statex
))
702 g_string_append_printf(str
, ", with ""%" G_GINT64_MODIFIER
"d" "MB of physical memory.\n", statex
.ullTotalPhys
/(1024*1024));
708 * Get various library run-time versions, and the OS version, and append
709 * them to the specified GString.
712 get_runtime_version_info(GString
*str
, void (*additional_info
)(GString
*))
718 g_string_append(str
, "on ");
720 get_os_version_info(str
);
724 if ((lang
= getenv ("LANG")) != NULL
)
725 g_string_append_printf(str
, ", with locale %s", lang
);
727 g_string_append(str
, ", without locale");
731 g_string_append(str
, ", ");
732 get_runtime_pcap_version(str
);
735 #if defined(HAVE_LIBZ) && !defined(_WIN32)
736 g_string_append_printf(str
, ", with libz %s", zlibVersion());
739 /* Additional application-dependent information */
741 (*additional_info
)(str
);
743 g_string_append(str
, ".");
748 /* Get info about installed memory Windows only */
754 * See https://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
755 * information on various defined strings.
757 * GCC's __VERSION__ is a nice text string for humans to
758 * read. The page at sourceforge.net largely describes
759 * numeric #defines that encode the version; if the compiler
760 * doesn't also offer a nice printable string, we try prettifying
761 * the number somehow.
763 #if defined(__GNUC__) && defined(__VERSION__)
765 * Clang and llvm-gcc also define __GNUC__ and __VERSION__;
766 * distinguish between them.
768 #if defined(__clang__)
769 g_string_append_printf(str
, "\n\nBuilt using clang %s.\n", __VERSION__
);
770 #elif defined(__llvm__)
771 g_string_append_printf(str
, "\n\nBuilt using llvm-gcc %s.\n", __VERSION__
);
772 #else /* boring old GCC */
773 g_string_append_printf(str
, "\n\nBuilt using gcc %s.\n", __VERSION__
);
775 #elif defined(__HP_aCC)
776 g_string_append_printf(str
, "\n\nBuilt using HP aCC %d.\n", __HP_aCC
);
777 #elif defined(__xlC__)
778 g_string_append_printf(str
, "\n\nBuilt using IBM XL C %d.%d\n",
779 (__xlC__
>> 8) & 0xFF, __xlC__
& 0xFF);
781 if ((__IBMC__
% 10) != 0)
782 g_string_append_printf(str
, " patch %d", __IBMC__
% 10);
783 #endif /* __IBMC__ */
784 g_string_append_printf(str
, "\n");
785 #elif defined(__INTEL_COMPILER)
786 g_string_append_printf(str
, "\n\nBuilt using Intel C %d.%d",
787 __INTEL_COMPILER
/ 100, (__INTEL_COMPILER
/ 10) % 10);
788 if ((__INTEL_COMPILER
% 10) != 0)
789 g_string_append_printf(str
, " patch %d", __INTEL_COMPILER
% 10);
790 #ifdef __INTEL_COMPILER_BUILD_DATE
791 g_string_sprinta(str
, ", compiler built %04d-%02d-%02d",
792 __INTEL_COMPILER_BUILD_DATE
/ 10000,
793 (__INTEL_COMPILER_BUILD_DATE
/ 100) % 100,
794 __INTEL_COMPILER_BUILD_DATE
% 100);
795 #endif /* __INTEL_COMPILER_BUILD_DATE */
796 g_string_append_printf(str
, "\n");
797 #elif defined(_MSC_FULL_VER)
798 # if _MSC_FULL_VER > 99999999
799 g_string_append_printf(str
, "\n\nBuilt using Microsoft Visual C++ %d.%d",
800 (_MSC_FULL_VER
/ 10000000) - 6,
801 (_MSC_FULL_VER
/ 100000) % 100);
802 # if (_MSC_FULL_VER % 100000) != 0
803 g_string_append_printf(str
, " build %d",
804 _MSC_FULL_VER
% 100000);
807 g_string_append_printf(str
, "\n\nBuilt using Microsoft Visual C++ %d.%d",
808 (_MSC_FULL_VER
/ 1000000) - 6,
809 (_MSC_FULL_VER
/ 10000) % 100);
810 # if (_MSC_FULL_VER % 10000) != 0
811 g_string_append_printf(str
, " build %d",
812 _MSC_FULL_VER
% 10000);
815 g_string_append_printf(str
, "\n");
816 #elif defined(_MSC_VER)
817 /* _MSC_FULL_VER not defined, but _MSC_VER defined */
818 g_string_append_printf(str
, "\n\nBuilt using Microsoft Visual C++ %d.%d\n",
819 (_MSC_VER
/ 100) - 6, _MSC_VER
% 100);
820 #elif defined(__SUNPRO_C)
821 g_string_append_printf(str
, "\n\nBuilt using Sun C %d.%d",
822 (__SUNPRO_C
>> 8) & 0xF, (__SUNPRO_C
>> 4) & 0xF);
823 if ((__SUNPRO_C
& 0xF) != 0)
824 g_string_append_printf(str
, " patch %d", __SUNPRO_C
& 0xF);
825 g_string_append_printf(str
, "\n");
832 * Get copyright information.
835 get_copyright_info(void)
838 "Copyright 1998-2013 Gerald Combs <gerald@wireshark.org> and contributors.\n"
839 "This is free software; see the source for copying conditions. There is NO\n"
840 "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
845 * Get the major OS version.
847 /* XXX - Should this return the minor version as well, e.g. 0x00050002? */
849 get_os_major_version()
852 info
.dwOSVersionInfoSize
= sizeof info
;
853 if (GetVersionEx(&info
)) {
854 return info
.dwMajorVersion
;
866 * indent-tabs-mode: t
869 * ex: set shiftwidth=8 tabstop=8 noexpandtab:
870 * :indentSize=8:tabSize=8:noTabs=false: