summaryrefslogtreecommitdiff
path: root/win32/win32.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-31 06:47:18 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-31 06:47:18 +0000
commitcd183fd9a4ee43af22288167daab9fa3d4dd8bae (patch)
tree5664b4d38df9e59fbc76b399e4293227f1b3877a /win32/win32.h
parent5089c844b09b4bf70ddcc69a1b2c187381eabf0c (diff)
downloadperl-cd183fd9a4ee43af22288167daab9fa3d4dd8bae.tar.gz
various Windows build tweaks
p4raw-id: //depot/perl@4743
Diffstat (limited to 'win32/win32.h')
-rw-r--r--win32/win32.h81
1 files changed, 43 insertions, 38 deletions
diff --git a/win32/win32.h b/win32/win32.h
index 24ba7c6784..b9fbaf4aa8 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -182,6 +182,9 @@ struct utsname {
# define MEMBER_TO_FPTR(name) &(name)
#endif
+/* Borland C thinks that a pointer to a member variable is 12 bytes in size. */
+#define PERL_MEMBER_PTR_SIZE 12
+
#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
@@ -191,45 +194,8 @@ typedef long gid_t;
typedef unsigned short mode_t;
#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
-#ifndef PERL_OBJECT
-
/* Visual C thinks that a pointer to a member variable is 16 bytes in size. */
-#define STRUCT_MGVTBL_DEFINITION \
-struct mgvtbl { \
- union { \
- int (CPERLscope(*svt_get))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem1[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_set))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem2[16]; \
- }; \
- union { \
- U32 (CPERLscope(*svt_len))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem3[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem4[16]; \
- }; \
- union { \
- int (CPERLscope(*svt_free))(pTHX_ SV *sv, MAGIC* mg); \
- char handle_VC_problem5[16]; \
- }; \
-}
-
-#define BASEOP_DEFINITION \
- OP* op_next; \
- OP* op_sibling; \
- OP* (CPERLscope(*op_ppaddr))(pTHX); \
- char handle_VC_problem[12]; \
- PADOFFSET op_targ; \
- OPCODE op_type; \
- U16 op_seq; \
- U8 op_flags; \
- U8 op_private;
-
-#endif /* PERL_OBJECT */
+#define PERL_MEMBER_PTR_SIZE 16
#endif /* _MSC_VER */
@@ -263,6 +229,45 @@ typedef long gid_t;
/* compatibility stuff for other compilers goes here */
+#if !defined(PERL_OBJECT) && defined(PERL_MEMBER_PTR_SIZE)
+# define STRUCT_MGVTBL_DEFINITION \
+struct mgvtbl { \
+ union { \
+ int (CPERLscope(*svt_get))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem1[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_set))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem2[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ U32 (CPERLscope(*svt_len))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem3[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem4[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_free))(pTHX_ SV *sv, MAGIC* mg); \
+ char handle_VC_problem5[PERL_MEMBER_PTR_SIZE]; \
+ }; \
+}
+
+# define BASEOP_DEFINITION \
+ OP* op_next; \
+ OP* op_sibling; \
+ OP* (CPERLscope(*op_ppaddr))(pTHX); \
+ char handle_VC_problem[PERL_MEMBER_PTR_SIZE-sizeof(OP*)]; \
+ PADOFFSET op_targ; \
+ OPCODE op_type; \
+ U16 op_seq; \
+ U8 op_flags; \
+ U8 op_private;
+
+#endif /* !PERL_OBJECT && PERL_MEMBER_PTR_SIZE */
+
+
START_EXTERN_C
/* For UNIX compatibility. */