|
82 | 82 | # define USE_MOUSE 1 |
83 | 83 | #endif |
84 | 84 |
|
| 85 | +#if defined(NCURSES_EXT_COLORS) && defined(NCURSES_EXT_FUNCS) |
| 86 | +# define SUPPORT_EXTENDED_COLORS 1 |
| 87 | +#else |
| 88 | +# define SUPPORT_EXTENDED_COLORS 0 |
| 89 | +#endif |
| 90 | + |
85 | 91 | #define OBJ2CHTYPE rb_obj2chtype_inline |
86 | 92 |
|
87 | 93 | static inline chtype |
@@ -1321,7 +1327,7 @@ curses_init_pair(VALUE obj, VALUE pair, VALUE f, VALUE b) |
1321 | 1327 | { |
1322 | 1328 | /* may have to raise exception on ERR */ |
1323 | 1329 | curses_stdscr(); |
1324 | | -#ifdef HAVE_INIT_EXTENDED_PAIR |
| 1330 | +#if SUPPORT_EXTENDED_COLORS |
1325 | 1331 | return (init_extended_pair(NUM2INT(pair), NUM2INT(f), NUM2INT(b)) == OK) ? Qtrue : Qfalse; |
1326 | 1332 | #else |
1327 | 1333 | return (init_pair(NUM2INT(pair),NUM2INT(f),NUM2INT(b)) == OK) ? Qtrue : Qfalse; |
@@ -1349,7 +1355,7 @@ curses_init_color(VALUE obj, VALUE color, VALUE r, VALUE g, VALUE b) |
1349 | 1355 | { |
1350 | 1356 | /* may have to raise exception on ERR */ |
1351 | 1357 | curses_stdscr(); |
1352 | | -#ifdef HAVE_INIT_EXTENDED_COLOR |
| 1358 | +#if SUPPORT_EXTENDED_COLORS |
1353 | 1359 | return (init_extended_color(NUM2INT(color), NUM2INT(r), |
1354 | 1360 | NUM2INT(g), NUM2INT(b)) == OK) ? Qtrue : Qfalse; |
1355 | 1361 | #else |
@@ -1407,7 +1413,7 @@ static VALUE |
1407 | 1413 | curses_color_content(VALUE obj, VALUE color) |
1408 | 1414 | { |
1409 | 1415 | curses_stdscr(); |
1410 | | -#ifdef HAVE_EXTENDED_COLOR_CONTENT |
| 1416 | +#if SUPPORT_EXTENDED_COLORS |
1411 | 1417 | { |
1412 | 1418 | int r, g, b; |
1413 | 1419 | if (extended_color_content(NUM2INT(color), &r, &g, &b) == ERR) |
@@ -1451,7 +1457,7 @@ static VALUE |
1451 | 1457 | curses_pair_content(VALUE obj, VALUE pair) |
1452 | 1458 | { |
1453 | 1459 | curses_stdscr(); |
1454 | | -#ifdef HAVE_EXTENDED_PAIR_CONTENT |
| 1460 | +#if SUPPORT_EXTENDED_COLORS |
1455 | 1461 | { |
1456 | 1462 | int f, b; |
1457 | 1463 | if (extended_pair_content(NUM2INT(pair), &f, &b) == ERR) |
@@ -1501,14 +1507,12 @@ curses_pair_number(VALUE obj, VALUE attrs) |
1501 | 1507 | * Document-method: Curses.support_extended_colors? |
1502 | 1508 | * |
1503 | 1509 | * Returns +true+ if the ncurses library was compiled with extended color |
1504 | | - * support (i.e., init_extended_pair, init_extended_color, etc. are available), |
1505 | | - * +false+ otherwise. |
| 1510 | + * support, +false+ otherwise. |
1506 | 1511 | */ |
1507 | 1512 | static VALUE |
1508 | 1513 | curses_support_extended_colors(VALUE obj) |
1509 | 1514 | { |
1510 | | -#if defined(HAVE_INIT_EXTENDED_PAIR) && defined(HAVE_INIT_EXTENDED_COLOR) && \ |
1511 | | - defined(HAVE_EXTENDED_COLOR_CONTENT) && defined(HAVE_EXTENDED_PAIR_CONTENT) |
| 1515 | +#if SUPPORT_EXTENDED_COLORS |
1512 | 1516 | return Qtrue; |
1513 | 1517 | #else |
1514 | 1518 | return Qfalse; |
|
0 commit comments