www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/22/23:45:21

From: omega782 AT aol DOT com (Omega782)
Newsgroups: comp.os.msdos.djgpp
Subject: LOCK_FUNCTION(x) macro
Lines: 29
NNTP-Posting-Host: ladder06.news.aol.com
X-Admin: news AT aol DOT com
Date: 23 May 2000 03:37:48 GMT
Organization: AOL http://www.aol.com
Message-ID: <20000522233748.17166.00000881@ng-bg1.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

The lock function macro described in the djgpp djgpp user's guide

("http://www.delorie.com/djgpp/doc/ug/interrupts/overview.html")

is defined as:

#define LOCK_FUNCTION(x)    _go32_dpmi_lock_code(x,(long)sizeof(x));

When I tried to use this, I got the compile time error:

"ANSI C++ forbids taking the sizeof a function type"

When I tried using the Allegro definition of lock function:

#define LOCK_CODE(c,s)        _go32_dpmi_lock_code((c), (s))
#define LOCK_FUNCTION(x)      LOCK_CODE(x, (long)x##_end - (long)x)

I got the error:

dspcabs.h:39: `DSpaceKeyboardInterruptHandler_end' undeclared (first use this
function)

(DSpaceKeyboardInterruptHandler is my ISR)

Does anyone know how I can get a LOCK_FUNCTION macro that works?

Thanks


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019