brltty/brltty-3.8-openmacro.patch
2007-08-22 12:52:24 +00:00

128 lines
4.3 KiB
Diff

Fix the calls to whatever->open to compile with newer glibc.
The glibc upstream has recently defined open as macro to check for incorrect
usage of the third parameter. This is correct, the POSIX standard says that it
may be declared in such a way. The attached patch redefines all those
> whatever->open(...)
calls to
> (whatever->open)(...)
. I also replaced the close calls, since close may be declared as macro too.
Signed-off-by: Tomas Janousek <tjanouse@redhat.com>
Reviewed-by: Stepan Kasal <skasal@redhat.com>
---
--- brltty-3.8/Programs/config.c.openmacro 2007-08-21 14:25:42.000000000 +0200
+++ brltty-3.8/Programs/config.c 2007-08-21 14:28:07.000000000 +0200
@@ -1383,13 +1383,13 @@
openBrailleDriver (void) {
initializeBraille();
- if (braille->open(&brl, brailleParameters, brailleDevice)) {
+ if ((braille->open)(&brl, brailleParameters, brailleDevice)) {
if (allocateBrailleBuffer(&brl)) {
brailleOpened = 1;
return 1;
}
- braille->close(&brl);
+ (braille->close)(&brl);
} else {
LogPrint(LOG_DEBUG, "%s: %s -> %s",
gettext("braille driver initialization failed"),
@@ -1403,7 +1403,7 @@
closeBrailleDriver (void) {
brailleOpened = 0;
drainBrailleOutput(&brl, 0);
- braille->close(&brl);
+ (braille->close)(&brl);
if (brl.isCoreBuffer) {
free(brl.buffer);
@@ -1657,7 +1657,7 @@
openSpeechDriver (void) {
initializeSpeech();
- if (speech->open(speechParameters)) {
+ if ((speech->open)(speechParameters)) {
return 1;
} else {
LogPrint(LOG_DEBUG, "speech driver initialization failed: %s",
@@ -1669,7 +1669,7 @@
void
closeSpeechDriver (void) {
- speech->close();
+ (speech->close)();
}
static int
--- brltty-3.8/Programs/tunes.c.openmacro 2007-08-21 14:25:42.000000000 +0200
+++ brltty-3.8/Programs/tunes.c 2007-08-21 14:28:54.000000000 +0200
@@ -480,7 +480,7 @@
}
if (!generator) return 0;
- if (noteGenerator) noteGenerator->close();
+ if (noteGenerator) (noteGenerator->close)();
closeTimer = 0;
noteGenerator = generator;
return 1;
@@ -490,7 +490,7 @@
closeTuneDevice (int force) {
if (closeTimer) {
if (force) closeTimer = 1;
- if (!--closeTimer) noteGenerator->close();
+ if (!--closeTimer) (noteGenerator->close)();
}
}
@@ -499,7 +499,7 @@
int tunePlayed = 0;
if (prefs.alertTunes && tune->elements) {
if (noteGenerator) {
- if (noteGenerator->open(openErrorLevel)) {
+ if ((noteGenerator->open)(openErrorLevel)) {
TuneElement *element = tune->elements;
tunePlayed = 1;
closeTimer = 2000 / updateInterval;
--- brltty-3.8/Programs/brltest.c.openmacro 2007-08-21 14:25:42.000000000 +0200
+++ brltty-3.8/Programs/brltest.c 2007-08-21 14:27:31.000000000 +0200
@@ -161,14 +161,14 @@
initializeBrailleDisplay(&brl);
brl.dataDirectory = opt_dataDirectory;
identifyBrailleDriver(braille, 0); /* start-up messages */
- if (braille->open(&brl, parameterSettings, opt_brailleDevice)) {
+ if ((braille->open)(&brl, parameterSettings, opt_brailleDevice)) {
if (allocateBrailleBuffer(&brl)) {
#ifdef ENABLE_LEARN_MODE
learnMode(&brl, updateInterval, 10000);
#else /* ENABLE_LEARN_MODE */
message("braille test", 0);
#endif /* ENABLE_LEARN_MODE */
- braille->close(&brl); /* finish with the display */
+ (braille->close)(&brl); /* finish with the display */
status = 0;
} else {
LogPrint(LOG_ERR, "can't allocate braille buffer.");
--- brltty-3.8/Programs/spktest.c.openmacro 2007-08-21 14:25:42.000000000 +0200
+++ brltty-3.8/Programs/spktest.c 2007-08-21 14:28:27.000000000 +0200
@@ -163,7 +163,7 @@
if (chdir(opt_dataDirectory) != -1) {
identifySpeechDriver(speech, 0); /* start-up messages */
- if (speech->open(parameterSettings)) {
+ if ((speech->open)(parameterSettings)) {
if (speech->rate) speech->rate(speechRate);
if (speech->volume) speech->volume(speechVolume);
@@ -172,7 +172,7 @@
} else {
processLines(stdin, sayLine, NULL);
}
- speech->close(); /* finish with the display */
+ (speech->close)(); /* finish with the display */
status = 0;
} else {
LogPrint(LOG_ERR, "can't initialize speech driver.");