[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"gmp.h" & MS C
From: |
Golubev I. N. |
Subject: |
"gmp.h" & MS C |
Date: |
Mon, 20 Aug 2001 16:50:35 (GMT) |
Version: 3.1.1
It is hardly practical to build gmp itself with microsoft visual C
toolkit, but building gmp clients with it may be required. Therefore
I am not going to adapt the entire gmp to msvc, but I need "gmp.h" to
be usable with it.
Compiling vanilla "gmp.h" involves the following troubles:
1. _INC_STDIO should be used in msvc to detect that <stdio.h> is
included;
2. In most compilers defined(__STDC__) means that it is not K&R C,
features of standard C (like ## in macros) are available. Perhaps
__STDC__ value is different depending on whether user specified strict
standard conformance or language extensions are allowed.
When compiling C in msvc, defined(__STDC__) means that microsoft C
lang extensions are disabled, strict standard conformance is
specified. In fact, msvc always implements full-featured C, and
standard C constructs should be used.
--- gmp.h Sun Sep 17 03:05:49 2000
+++ gmp.h Mon Aug 20 20:34:33 2001
@@ -33,7 +33,7 @@
#define _LONG_LONG_LIMB
#endif
-#if (__STDC__-0) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus) || defined (_MSC_VER)
#define __gmp_const const
#define __gmp_signed signed
#else
@@ -154,7 +154,7 @@
typedef __mpq_struct *mpq_ptr;
#ifndef _PROTO
-#if (__STDC__-0) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus) || defined (_MSC_VER)
#define _PROTO(x) x
#else
#define _PROTO(x) ()
@@ -163,7 +163,7 @@
#ifndef __MPN
/* Really use `defined (__STDC__)' here; we want it to be true for Sun C */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined (__STDC__) || defined (__cplusplus) || defined (_MSC_VER)
#define __MPN(x) __gmpn_##x
#else
#define __MPN(x) __gmpn_/**/x
@@ -172,7 +172,8 @@
#if defined (FILE) || defined (H_STDIO) || defined (_H_STDIO) \
|| defined (_STDIO_H) || defined (_STDIO_H_) || defined (__STDIO_H__) \
- || defined (_STDIO_INCLUDED) || defined (__dj_include_stdio_h_)
+ || defined (_STDIO_INCLUDED) || defined (__dj_include_stdio_h_) \
+ || defined (_INC_STDIO)
#define _GMP_H_HAVE_FILE 1
#endif
- "gmp.h" & MS C,
Golubev I. N. <=