Skip to content

Commit

Permalink
Merge pull request #142 from Bo98/big-sur-fix
Browse files Browse the repository at this point in the history
Fix compile error under macOS Big Sur
  • Loading branch information
davidfstr committed Jun 28, 2020
2 parents 676a381 + 0c6b850 commit 54cd695
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.0"
- "2.2.0"
Expand Down
44 changes: 22 additions & 22 deletions ext/rdiscount.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ static AccessorFlagPair ACCESSOR_2_FLAG[] = {

static VALUE rb_cRDiscount;

int rb_rdiscount__get_flags(VALUE ruby_obj)
{
AccessorFlagPair *entry;

/* compile flags */
int flags = MKD_TABSTOP | MKD_NOHEADER | MKD_DLEXTRA | MKD_FENCEDCODE | MKD_GITHUBTAGS;

/* The "smart" accessor turns OFF the MKD_NOPANTS flag. */
if ( rb_funcall(ruby_obj, rb_intern("smart"), 0) != Qtrue ) {
flags = flags | MKD_NOPANTS;
}

/* Handle standard flags declared in ACCESSOR_2_FLAG */
for ( entry = ACCESSOR_2_FLAG; entry->accessor_name; entry++ ) {
if ( rb_funcall(ruby_obj, rb_intern(entry->accessor_name), 0) == Qtrue ) {
flags = flags | entry->flag;
}
}

return flags;
}

static VALUE
rb_rdiscount_to_html(int argc, VALUE *argv, VALUE self)
{
Expand Down Expand Up @@ -117,28 +139,6 @@ rb_rdiscount_toc_content(int argc, VALUE *argv, VALUE self)
return buf;
}

int rb_rdiscount__get_flags(VALUE ruby_obj)
{
AccessorFlagPair *entry;

/* compile flags */
int flags = MKD_TABSTOP | MKD_NOHEADER | MKD_DLEXTRA | MKD_FENCEDCODE | MKD_GITHUBTAGS;

/* The "smart" accessor turns OFF the MKD_NOPANTS flag. */
if ( rb_funcall(ruby_obj, rb_intern("smart"), 0) != Qtrue ) {
flags = flags | MKD_NOPANTS;
}

/* Handle standard flags declared in ACCESSOR_2_FLAG */
for ( entry = ACCESSOR_2_FLAG; entry->accessor_name; entry++ ) {
if ( rb_funcall(ruby_obj, rb_intern(entry->accessor_name), 0) == Qtrue ) {
flags = flags | entry->flag;
}
}

return flags;
}


void Init_rdiscount()
{
Expand Down

0 comments on commit 54cd695

Please sign in to comment.