1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

successfully built with CYGWIN

This commit is contained in:
Lu Wang 2012-09-11 01:53:33 +08:00
parent ada013f385
commit 181d0242cc
8 changed files with 33 additions and 9 deletions

View File

@ -11,12 +11,16 @@ link_directories(${POPPLER_LIBRARY_DIRS})
find_path(FF_INCLUDE_PATH fontforge/fontforge.h)
if(FF_INCLUDE_PATH)
message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_INCLUDE_PATH}/fontforge/config.h")
include_directories(${FF_INCLUDE_PATH}/fontforge)
else()
message(FATAL_ERROR "Error: cannot locate fontforge.h")
endif()
find_path(FF_CONFIG_INCLUDE_PATH fontforge/config.h)
if(FF_CONFIG_INCLUDE_PATH)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_INCLUDE_PATH}/fontforge/config.h")
endif()
foreach(FF_LIB_NAME
${CMAKE_IMPORT_LIBRARY_PREFIX}fontforge${CMAKE_IMPORT_LIBRARY_SUFFIX}
${CMAKE_SHARED_LIBRARY_PREFIX}fontforge${CMAKE_SHARED_LIBRARY_SUFFIX}

View File

@ -64,7 +64,14 @@ void ArgParser::parse(int argc, char ** argv) const
if(p->name != "")
{
int v = (256 + (iter - arg_entries.begin()));
longopts.push_back({p->name.c_str(), ((p->need_arg) ? required_argument : no_argument), nullptr, v});
longopts.resize(longopts.size() + 1);
{
auto & cur = longopts.back();
cur.name = p->name.c_str();
cur.has_arg = ((p->need_arg) ? required_argument : no_argument);
cur.flag = nullptr;
cur.val = v;
}
if(!(opt_map.insert(make_pair(v, p)).second))
{
cerr << "Warning: duplicated shortname '" << v << "' used by --" << (p->name) << " and --" << (opt_map[p->shortname]->name) << endl;
@ -73,7 +80,14 @@ void ArgParser::parse(int argc, char ** argv) const
}
optstring.push_back(0);
longopts.push_back({0,0,0,0});
longopts.resize(longopts.size() + 1);
{
auto & cur = longopts.back();
cur.name = 0;
cur.has_arg = 0;
cur.flag = 0;
cur.val = 0;
}
{
opterr = 1;

View File

@ -15,6 +15,7 @@
using std::min;
using std::max;
using std::vector;
using std::ostream;
void HTMLRenderer::LineBuffer::reset(GfxState * state)
{

View File

@ -13,7 +13,6 @@
#include <stdarg.h>
#include <assert.h>
#include <fontforge/config.h>
#include <fontforge.h>
#include <baseviews.h>

View File

@ -14,6 +14,10 @@
#include <ostream>
#include <sstream>
#ifndef nullptr
#define nullptr (NULL)
#endif
class ArgParser
{
public:

View File

@ -12,8 +12,8 @@
#include <string>
static const std::string PDF2HTMLEX_VERSION = "0.3";
static const std::string PDF2HTMLEX_PREFIX = "/usr/local";
static const std::string PDF2HTMLEX_DATA_PATH = "/usr/local""/share/pdf2htmlEX";
static const std::string PDF2HTMLEX_PREFIX = "/usr";
static const std::string PDF2HTMLEX_DATA_PATH = "/usr""/share/pdf2htmlEX";
#endif //PDF2HTMLEX_CONFIG_H__

View File

@ -196,13 +196,13 @@ public:
va_list vlist;
va_start(vlist, format);
int l = std::vsnprintf(&buf.front(), buf.capacity(), format, vlist);
int l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
va_end(vlist);
if(l >= (int)buf.capacity())
{
buf.reserve(std::max((long)(l+1), (long)buf.capacity() * 2));
va_start(vlist, format);
l = std::vsnprintf(&buf.front(), buf.capacity(), format, vlist);
l = vsnprintf(&buf.front(), buf.capacity(), format, vlist);
va_end(vlist);
}
assert(l >= 0); // we should fail when vsnprintf fail

View File

@ -6,6 +6,8 @@
* 2012.08.10
*/
#include <errno.h>
#include <GfxState.h>
#include <GfxFont.h>
#include <CharTypes.h>
@ -22,7 +24,7 @@ using std::cerr;
using std::endl;
using std::string;
using std::map;
using std::ostream;
const double id_matrix[6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0};