From: ckline AT mitre DOT org (Christopher Kline) Subject: Problem porting with cygwin32 using VC++ 16 Jul 1997 19:02:23 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199707161654.MAA01048.cygnus.gnu-win32@orville.mitre.org> Reply-To: ckline AT acm DOT org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Original-To: gnu-win32 AT cygnus DOT com X-Mailer: VM 6.32 under 19.15p4 XEmacs Lucid X-Attribution: ck X-Mailer: Emacs 19.15p4 XEmacs Lucid with VM 6.32 Original-Sender: owner-gnu-win32 AT cygnus DOT com Hello everyone, I'm trying to use the cygwin32 library to port a Unix app over to NT. The project is being built in VC++ 5.0, and I can't seem to get the VC++ compiler to accept the inline assembly in the cygwin32 header. Here's the problem code: extern __inline__ unsigned long int __ntohl(unsigned long int x) { __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ "rorl $16,%0\n\t" /* swap words */ "xchgb %b0,%h0" /* swap higher bytes */ :"=q" (x) : "0" (x)); return x; } Apparently this was meant for Gnu compiler suite to interpret, but unfortunately I have to use VC++. I tried moving this over to what I thought VC++ wanted: extern __inline__ unsigned long int __ntohl(unsigned long int x) { __asm { xchgb %b0, %h0 rorl $16, %0 xchgb %b0, %h0 :"=q" (x) : "0" (x)); } return x; } but it doesn't like that either. Since I know nothing about VC++ inline assembly (and I'm new to NT and VC++), does anyone know how to get this to work? Any help from Windows gurus would be GREATLY appreciated! Thanks, Chris - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".