Skip to content

Commit c4b480a

Browse files
eagletmtyugui
authored andcommitted
Include libjsonnet_fmt.h if exists
fmt function declarations have been moved from libjsonnet.h since jsonnet v0.12.0. google/jsonnet#566
1 parent dc5c935 commit c4b480a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/jsonnet/extconf.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def install
3939

4040
FileUtils.cp(File.join(work_path, 'libjsonnet.a'), lib_path)
4141
FileUtils.cp(File.join(work_path, 'include', 'libjsonnet.h'), include_path)
42+
FileUtils.cp(File.join(work_path, 'include', 'libjsonnet_fmt.h'), include_path)
4243
end
4344
end
4445

@@ -57,4 +58,5 @@ def install
5758

5859
abort 'libjsonnet.h not found' unless have_header('libjsonnet.h')
5960
abort 'libjsonnet not found' unless have_library('jsonnet')
61+
have_header('libjsonnet_fmt.h')
6062
create_makefile('jsonnet/jsonnet_wrap')

ext/jsonnet/vm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include <libjsonnet.h>
2+
#ifdef HAVE_LIBJSONNET_FMT_H
3+
# include <libjsonnet_fmt.h>
4+
#endif
25
#include <ruby/ruby.h>
36
#include <ruby/intern.h>
47

0 commit comments

Comments
 (0)