Skip to content

Commit

Permalink
Fix using strlcpy and strlcat, respect CC
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Jul 30, 2008
1 parent a38df9f commit 3197850
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rakelib/vm.rake
Expand Up @@ -39,17 +39,17 @@ FLAGS = %w(-Wall -ggdb -gdwarf-2)

FLAGS << "-O2" if ENV['FAST']

def compile(obj, src)
cc = "gcc" # File.basename(src) == "c" ? "gcc" : "g++"
CC = ENV['CC'] || "gcc"

def compile(obj, src)
unless defined? $llvm_c then
$llvm_c = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
$llvm_c.delete_if { |e| e.index("-O") == 0 }
end

flags = (INCLUDES + FLAGS + $llvm_c).join(' ')

sh "#{cc} #{flags} -c -o #{obj} #{src} 2>&1"
sh "#{CC} #{flags} -c -o #{obj} #{src} 2>&1"
end

############################################################
Expand Down
6 changes: 4 additions & 2 deletions vm/ffi.cpp
Expand Up @@ -16,8 +16,10 @@
#include "ffi.hpp"
#include "message.hpp"

#include "strlcpy.h"
#include "strlcat.h"
extern "C" {
#include "strlcpy.h"
#include "strlcat.h"
}

#ifdef _WIN32
#define LIBSUFFIX ".dll"
Expand Down

0 comments on commit 3197850

Please sign in to comment.