hi,

the attached and below inlined does the following:

- hunk #1 prepares for when IPV6_ADD_MEMBERSHIP is defined by the 
  system; it is very synonymous with IPV6_JOIN_GROUP.
- hunk #2 makes initseg startup work with coff executables. (ok, 
  despite the heritage, i really don't know whether this includes pe 
  too :)

for #2, it might be that a simpler solution exists (macro-wise), but i 
am not smart enough to have that figured out.

Index: src/rtl/hbsocket.c
===================================================================
--- src/rtl/hbsocket.c  (revision 13390)
+++ src/rtl/hbsocket.c  (working copy)
@@ -2484,6 +2484,9 @@
       if( err > 0 )
       {
          mreq.ipv6mr_interface = 0;
+#if !defined( IPV6_JOIN_GROUP ) && defined( IPV6_ADD_MEMBERSHIP )
+#   define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
+#endif
          ret = setsockopt( sd, IPPROTO_IPV6, IPV6_JOIN_GROUP, ( const char * ) 
&mreq, sizeof( mreq ) );
          hb_socketSetOsError( ret != -1 ? 0 : HB_SOCK_GETERROR() );
          return ret;
Index: include/hbinit.h
===================================================================
--- include/hbinit.h    (revision 13390)
+++ include/hbinit.h    (working copy)
@@ -136,13 +136,20 @@
       static void func( void ) \
       {
 
-   #define HB_CALL_ON_STARTUP_END( func ) \
-      } \
-      HB_INIT_FUNCTION_REF( func ) \
-      HB_EXTERN_END \
-      asm ( ".section .init\n\tcall " HB_MACRO2STRING( func ) "\n\t.section 
.text\n\t" );
+   #if defined( _M_COFF )
+      #define HB_CALL_ON_STARTUP_END( func ) \
+         } \
+         HB_INIT_FUNCTION_REF( func ) \
+         HB_EXTERN_END \
+         asm ( ".section .init, \"x\"\n\tcall " HB_MACRO2STRING( func ) 
"\n\t.section .text\n\t" );
+   #else
+      #define HB_CALL_ON_STARTUP_END( func ) \
+         } \
+         HB_INIT_FUNCTION_REF( func ) \
+         HB_EXTERN_END \
+         asm ( ".section .init\n\tcall " HB_MACRO2STRING( func ) "\n\t.section 
.text\n\t" );
+   #endif
 
-
    #define HB_INIT_FUNCTION_REF( func )    \
       extern void * func##_ref_( void ); \
       void * func##_ref_( void ) \


-- 
[-]

mkdir /nonexistent
Index: src/rtl/hbsocket.c
===================================================================
--- src/rtl/hbsocket.c	(revision 13390)
+++ src/rtl/hbsocket.c	(working copy)
@@ -2484,6 +2484,9 @@
       if( err > 0 )
       {
          mreq.ipv6mr_interface = 0;
+#if !defined( IPV6_JOIN_GROUP ) && defined( IPV6_ADD_MEMBERSHIP )
+#   define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
+#endif
          ret = setsockopt( sd, IPPROTO_IPV6, IPV6_JOIN_GROUP, ( const char * ) &mreq, sizeof( mreq ) );
          hb_socketSetOsError( ret != -1 ? 0 : HB_SOCK_GETERROR() );
          return ret;
Index: include/hbinit.h
===================================================================
--- include/hbinit.h	(revision 13390)
+++ include/hbinit.h	(working copy)
@@ -136,13 +136,20 @@
       static void func( void ) \
       {
 
-   #define HB_CALL_ON_STARTUP_END( func ) \
-      } \
-      HB_INIT_FUNCTION_REF( func ) \
-      HB_EXTERN_END \
-      asm ( ".section .init\n\tcall " HB_MACRO2STRING( func ) "\n\t.section .text\n\t" );
+   #if defined( _M_COFF )
+      #define HB_CALL_ON_STARTUP_END( func ) \
+         } \
+         HB_INIT_FUNCTION_REF( func ) \
+         HB_EXTERN_END \
+         asm ( ".section .init, \"x\"\n\tcall " HB_MACRO2STRING( func ) "\n\t.section .text\n\t" );
+   #else
+      #define HB_CALL_ON_STARTUP_END( func ) \
+         } \
+         HB_INIT_FUNCTION_REF( func ) \
+         HB_EXTERN_END \
+         asm ( ".section .init\n\tcall " HB_MACRO2STRING( func ) "\n\t.section .text\n\t" );
+   #endif
 
-
    #define HB_INIT_FUNCTION_REF( func )    \
       extern void * func##_ref_( void ); \
       void * func##_ref_( void ) \
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to