Fix the vast majority of Interrogate parse issues and warnings, add support for inline namespace and constexpr

This commit is contained in:
rdb 2015-10-16 14:57:40 +02:00
parent 6a0c98d54e
commit 920210c999
67 changed files with 3067 additions and 2635 deletions

View File

@ -1 +0,0 @@
#include "ai_composite1.cxx"

View File

@ -2359,8 +2359,8 @@ _inP07yte_7S(PyObject *, PyObject *args) {
*/ */
static PyObject * static PyObject *
_inP07ytw_15(PyObject *, PyObject *args) { _inP07ytw_15(PyObject *, PyObject *args) {
int param0; Py_ssize_t param0;
if (PyArg_ParseTuple(args, "i", &param0)) { if (PyArg_ParseTuple(args, "n", &param0)) {
interrogate_request_module((InterrogateModuleDef *)param0); interrogate_request_module((InterrogateModuleDef *)param0);
return Py_BuildValue(""); return Py_BuildValue("");
} }

File diff suppressed because it is too large Load Diff

View File

@ -577,56 +577,60 @@ storage_class:
{ {
$$ = 0; $$ = 0;
} }
| storage_class KW_EXTERN | KW_EXTERN storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_extern; $$ = $2 | (int)CPPInstance::SC_extern;
} }
| storage_class KW_EXTERN SIMPLE_STRING | KW_EXTERN SIMPLE_STRING storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_extern; $$ = $3 | (int)CPPInstance::SC_extern;
if ($3 == "C") { if ($2 == "C") {
$$ |= (int)CPPInstance::SC_c_binding; $$ |= (int)CPPInstance::SC_c_binding;
} else if ($3 == "C++") { } else if ($2 == "C++") {
$$ &= ~(int)CPPInstance::SC_c_binding; $$ &= ~(int)CPPInstance::SC_c_binding;
} else { } else {
yywarning("Ignoring unknown linkage type \"" + $3 + "\"", @3); yywarning("Ignoring unknown linkage type \"" + $2 + "\"", @2);
} }
} }
| storage_class KW_STATIC | KW_STATIC storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_static; $$ = $2 | (int)CPPInstance::SC_static;
} }
| storage_class KW_INLINE | KW_INLINE storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_inline; $$ = $2 | (int)CPPInstance::SC_inline;
} }
| storage_class KW_VIRTUAL | KW_VIRTUAL storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_virtual; $$ = $2 | (int)CPPInstance::SC_virtual;
} }
| storage_class KW_EXPLICIT | KW_EXPLICIT storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_explicit; $$ = $2 | (int)CPPInstance::SC_explicit;
} }
| storage_class KW_VOLATILE | KW_REGISTER storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_volatile; $$ = $2 | (int)CPPInstance::SC_register;
} }
| storage_class KW_MUTABLE | KW_VOLATILE storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_mutable; $$ = $2 | (int)CPPInstance::SC_volatile;
} }
| storage_class KW_REGISTER | KW_MUTABLE storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_register; $$ = $2 | (int)CPPInstance::SC_mutable;
} }
| storage_class KW_BLOCKING | KW_CONSTEXPR storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_blocking; $$ = $2 | (int)CPPInstance::SC_constexpr;
} }
| storage_class KW_EXTENSION | KW_BLOCKING storage_class
{ {
$$ = $1 | (int)CPPInstance::SC_extension; $$ = $2 | (int)CPPInstance::SC_blocking;
}
| KW_EXTENSION storage_class
{
$$ = $2 | (int)CPPInstance::SC_extension;
} }
; ;
@ -810,16 +814,18 @@ function_prototype:
} }
formal_parameter_list ')' function_post formal_parameter_list ')' function_post
{ {
pop_scope();
CPPType *type; CPPType *type;
if ($1->get_simple_name() == current_scope->get_simple_name()) { if ($1->get_simple_name() == current_scope->get_simple_name() ||
$1->get_simple_name() == string("~") + current_scope->get_simple_name()) {
// This is a constructor, and has no return. // This is a constructor, and has no return.
type = new CPPSimpleType(CPPSimpleType::T_void); type = new CPPSimpleType(CPPSimpleType::T_void);
} else { } else {
// This isn't a constructor, so it has an implicit return type of // This isn't a constructor, so it has an implicit return type of
// int. // int.
yywarning("function has no return type, assuming int", @1);
type = new CPPSimpleType(CPPSimpleType::T_int); type = new CPPSimpleType(CPPSimpleType::T_int);
} }
pop_scope();
CPPInstanceIdentifier *ii = new CPPInstanceIdentifier($1); CPPInstanceIdentifier *ii = new CPPInstanceIdentifier($1);
ii->add_func_modifier($4, $6); ii->add_func_modifier($4, $6);
@ -1463,14 +1469,6 @@ formal_parameter:
{ {
$$ = new CPPInstance($1, $2, 0, @2.file); $$ = new CPPInstance($1, $2, 0, @2.file);
$$->set_initializer($3); $$->set_initializer($3);
}
| IDENTIFIER formal_parameter_identifier maybe_initialize
{
yywarning("Not a type: " + $1->get_fully_scoped_name(), @1);
CPPType *type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown));
$$ = new CPPInstance(type, $2, 0, @2.file);
$$->set_initializer($3);
} }
| KW_CONST type formal_parameter_identifier maybe_initialize | KW_CONST type formal_parameter_identifier maybe_initialize
{ {
@ -2101,8 +2099,32 @@ namespace_declaration:
cpp '}' cpp '}'
{ {
pop_scope(); pop_scope();
}
| KW_INLINE KW_NAMESPACE name '{'
{
CPPScope *scope = $3->find_scope(current_scope, global_scope, current_lexer);
if (scope == NULL) {
// This must be a new namespace declaration.
CPPScope *parent_scope =
$3->get_scope(current_scope, global_scope, current_lexer);
if (parent_scope == NULL) {
parent_scope = current_scope;
}
scope = new CPPScope(parent_scope, $3->_names.back(), V_public);
}
CPPNamespace *nspace = new CPPNamespace($3, scope, @2.file);
nspace->_inline = true;
current_scope->add_declaration(nspace, global_scope, current_lexer, @2);
current_scope->define_namespace(nspace);
push_scope(scope);
}
cpp '}'
{
pop_scope();
} }
| KW_NAMESPACE '{' cpp '}' | KW_NAMESPACE '{' cpp '}'
| KW_INLINE KW_NAMESPACE '{' cpp '}'
; ;
using_declaration: using_declaration:
@ -2929,6 +2951,10 @@ formal_const_operand:
| CUSTOM_LITERAL | CUSTOM_LITERAL
{ {
$$ = $1; $$ = $1;
}
| IDENTIFIER
{
$$ = new CPPExpression($1, current_scope, global_scope, current_lexer);
} }
| KW_NULLPTR | KW_NULLPTR
{ {

View File

@ -82,6 +82,7 @@ add_element(const string &name, CPPExpression *value) {
inst = new CPPInstance(CPPType::new_type(new CPPConstType(_element_type)), ident); inst = new CPPInstance(CPPType::new_type(new CPPConstType(_element_type)), ident);
} }
inst->_storage_class |= CPPInstance::SC_constexpr;
_elements.push_back(inst); _elements.push_back(inst);
if (value == (CPPExpression *)NULL) { if (value == (CPPExpression *)NULL) {

View File

@ -531,6 +531,10 @@ evaluate() const {
case T_variable: case T_variable:
if (_u._variable->_type != NULL && if (_u._variable->_type != NULL &&
_u._variable->_initializer != NULL) { _u._variable->_initializer != NULL) {
// A constexpr variable, which is treated as const.
if (_u._variable->_storage_class & CPPInstance::SC_constexpr) {
return _u._variable->_initializer->evaluate();
}
// A const variable. Fetch its assigned value. // A const variable. Fetch its assigned value.
CPPConstType *const_type = _u._variable->_type->as_const_type(); CPPConstType *const_type = _u._variable->_type->as_const_type();
if (const_type != NULL) { if (const_type != NULL) {
@ -1227,6 +1231,9 @@ is_tbd() const {
case T_variable: case T_variable:
if (_u._variable->_type != NULL && if (_u._variable->_type != NULL &&
_u._variable->_initializer != NULL) { _u._variable->_initializer != NULL) {
if (_u._variable->_storage_class & CPPInstance::SC_constexpr) {
return false;
}
CPPConstType *const_type = _u._variable->_type->as_const_type(); CPPConstType *const_type = _u._variable->_type->as_const_type();
if (const_type != NULL) { if (const_type != NULL) {
return false; return false;
@ -1363,9 +1370,10 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
if (_u._variable->_type != NULL && if (_u._variable->_type != NULL &&
_u._variable->_initializer != NULL && _u._variable->_initializer != NULL &&
_u._variable->_vis > V_public) { _u._variable->_vis > V_public) {
// A const variable. Fetch its assigned value. // A constexpr or const variable. Fetch its assigned value.
CPPConstType *const_type = _u._variable->_type->as_const_type(); CPPConstType *const_type = _u._variable->_type->as_const_type();
if (const_type != NULL) { if ((_u._variable->_storage_class & CPPInstance::SC_constexpr) != 0 ||
const_type != NULL) {
_u._variable->_initializer->output(out, indent_level, scope, false); _u._variable->_initializer->output(out, indent_level, scope, false);
break; break;
} }

View File

@ -187,6 +187,12 @@ get_local_name(CPPScope *scope) const {
// last name. // last name.
CPPScope *my_scope = get_scope(scope, NULL); CPPScope *my_scope = get_scope(scope, NULL);
// Strip off template scopes, since they don't add anything
// particularly meaningful to the local name.
while (my_scope->as_template_scope() != NULL) {
my_scope = my_scope->get_parent_scope();
}
if (my_scope == NULL) { if (my_scope == NULL) {
result = get_fully_scoped_name(); result = get_fully_scoped_name();
} else if (my_scope == scope) { } else if (my_scope == scope) {
@ -463,7 +469,12 @@ find_symbol(CPPScope *current_scope, CPPScope *global_scope,
CPPDeclaration *sym; CPPDeclaration *sym;
if (!_names.back().has_templ()) { if (!_names.back().has_templ()) {
if (_names.size() > 1 && scope->get_simple_name() == get_simple_name()) {
// An identifier like Class::Class always refers to the class constructor.
sym = scope->get_struct_type()->get_constructor();
} else {
sym = scope->find_symbol(get_simple_name()); sym = scope->find_symbol(get_simple_name());
}
} else { } else {
sym = scope->find_template(get_simple_name()); sym = scope->find_template(get_simple_name());
@ -499,7 +510,12 @@ find_symbol(CPPScope *current_scope, CPPScope *global_scope,
CPPDeclaration *sym; CPPDeclaration *sym;
if (!_names.back().has_templ()) { if (!_names.back().has_templ()) {
if (_names.size() > 1 && scope->get_simple_name() == get_simple_name()) {
// An identifier like Class::Class always refers to the class constructor.
sym = scope->get_struct_type()->get_constructor();
} else {
sym = scope->find_symbol(get_simple_name()); sym = scope->find_symbol(get_simple_name());
}
} else { } else {
sym = scope->find_template(get_simple_name()); sym = scope->find_template(get_simple_name());

View File

@ -601,6 +601,9 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete,
if (_storage_class & SC_mutable) { if (_storage_class & SC_mutable) {
out << "mutable "; out << "mutable ";
} }
if (_storage_class & SC_constexpr) {
out << "constexpr ";
}
string name; string name;
if (_ident != NULL) { if (_ident != NULL) {

View File

@ -46,19 +46,20 @@ public:
SC_pure_virtual = 0x0080, SC_pure_virtual = 0x0080,
SC_volatile = 0x0100, SC_volatile = 0x0100,
SC_mutable = 0x0200, SC_mutable = 0x0200,
SC_constexpr = 0x0400,
// This bit is only set by CPPStructType::check_virtual(). // This bit is only set by CPPStructType::check_virtual().
SC_inherited_virtual = 0x0400, SC_inherited_virtual = 0x0800,
// This is a special "storage class" for methods tagged with the // This is a special "storage class" for methods tagged with the
// BLOCKING macro (i.e. the special __blocking keyword). These // BLOCKING macro (i.e. the special __blocking keyword). These
// are methods that might block and therefore need to release // are methods that might block and therefore need to release
// Python threads for their duration. // Python threads for their duration.
SC_blocking = 0x0800, SC_blocking = 0x1000,
// And this is for methods tagged with __extension, which declares // And this is for methods tagged with __extension, which declares
// extension methods defined separately from the source code. // extension methods defined separately from the source code.
SC_extension = 0x1000, SC_extension = 0x2000,
}; };
CPPInstance(CPPType *type, const string &name, int storage_class = 0); CPPInstance(CPPType *type, const string &name, int storage_class = 0);

View File

@ -26,7 +26,9 @@
CPPNamespace:: CPPNamespace::
CPPNamespace(CPPIdentifier *ident, CPPScope *scope, const CPPFile &file) : CPPNamespace(CPPIdentifier *ident, CPPScope *scope, const CPPFile &file) :
CPPDeclaration(file), CPPDeclaration(file),
_ident(ident), _scope(scope) _ident(ident),
_scope(scope),
_inline(false)
{ {
} }
@ -86,6 +88,9 @@ get_scope() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void CPPNamespace:: void CPPNamespace::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const { output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
if (_inline) {
out << "inline ";
}
if (!complete && _ident != NULL) { if (!complete && _ident != NULL) {
// If we have a name, use it. // If we have a name, use it.
out << "namespace " << _ident->get_local_name(scope); out << "namespace " << _ident->get_local_name(scope);

View File

@ -42,6 +42,8 @@ public:
virtual CPPNamespace *as_namespace(); virtual CPPNamespace *as_namespace();
bool _inline;
private: private:
CPPIdentifier *_ident; CPPIdentifier *_ident;
CPPScope *_scope; CPPScope *_scope;

View File

@ -292,10 +292,15 @@ define_extension_type(CPPExtensionType *type, CPPPreprocessor *error_sink) {
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void CPPScope:: void CPPScope::
define_namespace(CPPNamespace *scope) { define_namespace(CPPNamespace *ns) {
string name = scope->get_simple_name(); string name = ns->get_simple_name();
_namespaces[name] = scope; _namespaces[name] = ns;
if (ns->_inline) {
// Add an implicit using declaration for an inline namespace.
_using.insert(ns->get_scope());
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View File

@ -277,6 +277,26 @@ is_incomplete() const {
return _incomplete; return _incomplete;
} }
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::get_constructor
// Access: Public
// Description: Returns the constructor defined for the struct type,
// if any, or NULL if no constructor is found.
////////////////////////////////////////////////////////////////////
CPPFunctionGroup *CPPStructType::
get_constructor() const {
// Iterate through all the functions that begin with '~' until we
// find one that claims to be a destructor. In theory, there should
// only be one such function.
CPPScope::Functions::const_iterator fi;
fi = _scope->_functions.find(get_simple_name());
if (fi != _scope->_functions.end()) {
return fi->second;
} else {
return (CPPFunctionGroup *)NULL;
}
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: CPPStructType::get_destructor // Function: CPPStructType::get_destructor
// Access: Public // Access: Public

View File

@ -49,6 +49,7 @@ public:
virtual bool is_incomplete() const; virtual bool is_incomplete() const;
virtual bool is_trivial() const; virtual bool is_trivial() const;
CPPFunctionGroup *get_constructor() const;
CPPInstance *get_destructor() const; CPPInstance *get_destructor() const;
virtual CPPDeclaration * virtual CPPDeclaration *

View File

@ -254,8 +254,6 @@
#define TAU_TRACK_MEMORY_HERE() #define TAU_TRACK_MEMORY_HERE()
#define TAU_ENABLE_TRACKING_MEMORY() #define TAU_ENABLE_TRACKING_MEMORY()
#define TAU_DISABLE_TRACKING_MEMORY() #define TAU_DISABLE_TRACKING_MEMORY()
#define TAU_TRACK_MEMORY()
#define TAU_TRACK_MEMORY_HERE()
#define TAU_ENABLE_TRACKING_MUSE_EVENTS() #define TAU_ENABLE_TRACKING_MUSE_EVENTS()
#define TAU_DISABLE_TRACKING_MUSE_EVENTS() #define TAU_DISABLE_TRACKING_MUSE_EVENTS()
#define TAU_TRACK_MUSE_EVENTS() #define TAU_TRACK_MUSE_EVENTS()

View File

@ -34,7 +34,7 @@ using namespace std;
#define INLINE inline #define INLINE inline
#define ALWAYS_INLINE inline #define ALWAYS_INLINE inline
#define TYPENAME typename #define TYPENAME typename
#define CONSTEXPR #define CONSTEXPR constexpr
#define NOEXCEPT noexcept #define NOEXCEPT noexcept
#define FINAL #define FINAL
#define OVERRIDE #define OVERRIDE

View File

@ -36,7 +36,7 @@
// regular volatile keyword. // regular volatile keyword.
#define TVOLATILE volatile #define TVOLATILE volatile
#if !defined(HAVE_THREADS) #if !defined(HAVE_THREADS) || defined(CPPPARSER)
// With threading disabled, use the do-nothing implementation. // With threading disabled, use the do-nothing implementation.
#define THREAD_DUMMY_IMPL 1 #define THREAD_DUMMY_IMPL 1

View File

@ -412,6 +412,16 @@ remap_parameter(CPPType *struct_type, CPPType *param_type) {
} else if (TypeManager::is_const_ptr_to_basic_string_wchar(param_type)) { } else if (TypeManager::is_const_ptr_to_basic_string_wchar(param_type)) {
return new ParameterRemapBasicWStringPtrToWString(param_type); return new ParameterRemapBasicWStringPtrToWString(param_type);
} else if (TypeManager::is_reference(param_type) ||
TypeManager::is_pointer(param_type)) {
// Python strings are immutable, so we can't wrap a non-const
// pointer or reference to a string.
CPPType *pt_type = TypeManager::unwrap(param_type);
if (TypeManager::is_basic_string_char(pt_type) ||
TypeManager::is_basic_string_wchar(pt_type)) {
return (ParameterRemap *)NULL;
}
} }
} }
} }

View File

@ -360,8 +360,8 @@ void InterfaceMakerPythonSimple::write_function_instance(ostream &out, Interface
pexpr_string = param_name; pexpr_string = param_name;
} else if (TypeManager::is_pointer(type)) { } else if (TypeManager::is_pointer(type)) {
out << "int " << param_name; out << "Py_ssize_t " << param_name;
format_specifiers += "i"; format_specifiers += "n";
parameter_list += ", &" + param_name; parameter_list += ", &" + param_name;
} else { } else {

View File

@ -264,6 +264,9 @@ build() {
ci != _forcetype.end(); ci != _forcetype.end();
++ci) { ++ci) {
CPPType *type = parser.parse_type(*ci); CPPType *type = parser.parse_type(*ci);
if (type == NULL) {
cerr << "Failure to parse forcetype " << *ci << "\n";
}
assert(type != (CPPType *)NULL); assert(type != (CPPType *)NULL);
get_type(type, true); get_type(type, true);
} }

View File

@ -2295,7 +2295,7 @@ get_basic_string_char_type() {
static bool got_type = false; static bool got_type = false;
static CPPType *type = (CPPType *)NULL; static CPPType *type = (CPPType *)NULL;
if (!got_type) { if (!got_type) {
type = parser.parse_type("basic_string<char>"); type = parser.parse_type("std::basic_string<char>");
got_type = true; got_type = true;
} }
return type; return type;
@ -2312,7 +2312,7 @@ get_basic_string_wchar_type() {
static bool got_type = false; static bool got_type = false;
static CPPType *type = (CPPType *)NULL; static CPPType *type = (CPPType *)NULL;
if (!got_type) { if (!got_type) {
type = parser.parse_type("basic_string<wchar_t>"); type = parser.parse_type("std::basic_string<wchar_t>");
got_type = true; got_type = true;
} }
return type; return type;

View File

@ -1,6 +1,4 @@
namespace Eigen { namespace Eigen {
template <class type, int rows, int cols> template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Matrix { class Matrix;
};
}; };

View File

View File

@ -1,9 +1,11 @@
#pragma once
class bt32BitAxisSweep3; class bt32BitAxisSweep3;
class btActionInterface; class btActionInterface;
class btAxisSweep3; class btAxisSweep3;
class btBoxShape; class btBoxShape;
class btBroadphaseInterface; class btBroadphaseInterface;
class btBroadphaseProxy;
class btBulletWorldImporter; class btBulletWorldImporter;
class btBvhTriangleMeshShape; class btBvhTriangleMeshShape;
class btCapsuleShape; class btCapsuleShape;

View File

@ -0,0 +1 @@
#include <float.h>

View File

@ -0,0 +1,4 @@
#pragma once
typedef float float_t;
typedef double double_t;

View File

@ -0,0 +1,7 @@
#pragma once
#define EDOM 33
#define EILSEQ 84
#define ERANGE 34
extern int errno;

View File

@ -0,0 +1,7 @@
#pragma once
typedef int pid_t;
typedef long int off_t;
typedef unsigned int mode_t;
struct flock;

View File

@ -0,0 +1,18 @@
#pragma once
#define FLT_RADIX 2
#define DECIMAL_DIG 21
#define FLT_MIN 1.17549435e-38F
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_MIN 3.36210314311209350626e-4932L
#define FLT_MAX 3.40282347e+38F
#define DBL_MAX 1.7976931348623157e+308
#define LDBL_MAX 1.18973149535723176502e+4932L
#define FLT_DIG 6
#define DBL_DIG 15
#define LDBL_DIG 18
#define FLT_EVAL_METHOD -1

View File

@ -23,6 +23,7 @@
// This definition is intentionally recursive. Why complicate things // This definition is intentionally recursive. Why complicate things
// with multiple files? // with multiple files?
#define FT_FREETYPE_H <ft2build.h> #define FT_FREETYPE_H <ft2build.h>
#define FT_OUTLINE_H <ft2build.h>
class FT_Face; class FT_Face;
class FT_Library; class FT_Library;

View File

@ -0,0 +1,6 @@
#pragma once
namespace std {
template<class Iterator> class iterator;
template<class Iterator> class reverse_iterator;
};

View File

@ -0,0 +1,5 @@
#pragma once
namespace std {
template<class T> class numeric_limits;
};

View File

@ -21,10 +21,12 @@
#define LIST_H #define LIST_H
#include <stdtypedefs.h> #include <stdtypedefs.h>
#include <memory>
template<class element> namespace std {
class list { template<class element, class Allocator = std::allocator<element>>
public: class list {
public:
typedef element value_type; typedef element value_type;
typedef element *pointer; typedef element *pointer;
@ -38,6 +40,7 @@ public:
class const_reverse_iterator; class const_reverse_iterator;
typedef size_t size_type; typedef size_t size_type;
class difference_type; class difference_type;
}; };
}
#endif #endif

View File

@ -0,0 +1,9 @@
#pragma once
#define LC_CTYPE 0
#define LC_NUMERIC 1
#define LC_TIME 2
#define LC_COLLATE 3
#define LC_MONETARY 4
#define LC_MESSAGES 5
#define LC_ALL 6

View File

@ -32,16 +32,18 @@ public:
#else // GCC_STYLE_ALLOCATOR #else // GCC_STYLE_ALLOCATOR
template<class Type> namespace std {
class allocator { template<class Type>
public: class allocator {
public:
typedef Type *pointer; typedef Type *pointer;
typedef const Type *const_pointer; typedef const Type *const_pointer;
typedef size_t size_type; typedef size_t size_type;
INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0); pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
INLINE void deallocate(pointer p, size_type n); void deallocate(pointer p, size_type n);
}; };
}
#endif // GCC_STYLE_ALLOCATOR #endif // GCC_STYLE_ALLOCATOR

View File

@ -20,7 +20,6 @@
#define _ODE_CONFIG_H_ #define _ODE_CONFIG_H_
#define dSINGLE 1 #define dSINGLE 1
#define _MSC_VER 1
#define ODE_PLATFORM_WINDOWS #define ODE_PLATFORM_WINDOWS
#if !defined(ODE_API) #if !defined(ODE_API)

View File

@ -20,7 +20,6 @@
#define _ODE_CONFIG_H_ #define _ODE_CONFIG_H_
#define dSINGLE 1 #define dSINGLE 1
#define _MSC_VER 1
#define ODE_PLATFORM_WINDOWS #define ODE_PLATFORM_WINDOWS
#if !defined(ODE_API) #if !defined(ODE_API)

View File

@ -0,0 +1,14 @@
#ifndef _OGG_H
#define _OGG_H
#include <stddef.h>
#include <ogg/os_types.h>
typedef struct {} ogg_iovec_t;
typedef struct {} oggpack_buffer;
typedef struct {} ogg_page;
typedef struct {} ogg_stream_state;
typedef struct {} ogg_packet;
typedef struct {} ogg_sync_state;
#endif

View File

@ -0,0 +1,9 @@
#ifndef SQUISH_H
#define SQUISH_H
namespace squish {
typedef unsigned char u8;
};
#endif

View File

@ -0,0 +1,23 @@
#pragma once
namespace std {
template <class charT,
class traits = char_traits<charT>,
class Allocator = allocator<charT> >
class basic_stringbuf;
template <class charT,
class traits = char_traits<charT>,
class Allocator = allocator<charT> >
class basic_istringstream;
template <class charT,
class traits = char_traits<charT>,
class Allocator = allocator<charT> >
class basic_ostringstream;
template <class charT,
class traits = char_traits<charT>,
class Allocator = allocator<charT> >
class basic_stringstream;
};

View File

@ -5,4 +5,8 @@
struct FILE; struct FILE;
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif #endif

View File

@ -19,27 +19,26 @@
#ifndef STDTYPEDEFS_H #ifndef STDTYPEDEFS_H
#define STDTYPEDEFS_H #define STDTYPEDEFS_H
typedef int off_t;
typedef long time_t;
typedef long clock_t;
namespace std {
}
typedef unsigned int uint; typedef unsigned int uint;
typedef unsigned long ulong; typedef unsigned long ulong;
typedef unsigned short ushort; typedef unsigned short ushort;
typedef unsigned char uchar; typedef unsigned char uchar;
inline namespace std {
typedef long time_t;
typedef long clock_t;
#ifdef _WIN64 #ifdef _WIN64
typedef unsigned long long size_t; typedef unsigned long long size_t;
typedef long long ssize_t; typedef long long ssize_t;
typedef long long ptrdiff_t; typedef long long ptrdiff_t;
#else #else
typedef unsigned long size_t; typedef unsigned long size_t;
typedef long ssize_t; typedef long ssize_t;
typedef long ptrdiff_t; typedef long ptrdiff_t;
#endif #endif
}
#ifdef __cplusplus #ifdef __cplusplus
#define NULL 0L #define NULL 0L

View File

@ -22,15 +22,24 @@
#include <stdtypedefs.h> #include <stdtypedefs.h>
template<class ctype> namespace std {
class basic_string { template<class charT>
public: class char_traits;
template<class ctype>
class basic_string {
public:
struct iterator;
struct const_iterator;
struct reverse_iterator;
struct const_reverse_iterator;
typedef typename size_t size_type; typedef typename size_t size_type;
static const size_t npos = -1; static const size_t npos = -1;
basic_string(); basic_string();
basic_string(const basic_string &copy); basic_string(const basic_string<ctype> &copy);
void operator = (const basic_string &copy); void operator = (const basic_string<ctype> &copy);
basic_string(const ctype *string); basic_string(const ctype *string);
~basic_string(); ~basic_string();
@ -40,29 +49,26 @@ public:
ctype at(size_t pos) const; ctype at(size_t pos) const;
ctype operator[](size_t pos) const; ctype operator[](size_t pos) const;
ctype &operator[](size_t pos); ctype &operator[](size_t pos);
}; };
typedef basic_string<char> string; typedef basic_string<char> string;
typedef basic_string<wchar_t> wstring; typedef basic_string<wchar_t> wstring;
typedef basic_string<char16_t> u16string; typedef basic_string<char16_t> u16string;
typedef basic_string<char32_t> u32string; typedef basic_string<char32_t> u32string;
namespace std {
template<class T> struct hash; template<class T> struct hash;
template<> struct hash<string>; template<> struct hash<string>;
template<> struct hash<u16string>; template<> struct hash<u16string>;
template<> struct hash<u32string>; template<> struct hash<u32string>;
template<> struct hash<wstring>; template<> struct hash<wstring>;
namespace string_literals { inline namespace literals {
inline namespace string_literals {
string operator "" s(const char *str, size_t len); string operator "" s(const char *str, size_t len);
wstring operator "" s(const wchar_t *str, size_t len); wstring operator "" s(const wchar_t *str, size_t len);
u16string operator "" s(const char16_t *str, size_t len); u16string operator "" s(const char16_t *str, size_t len);
u32string operator "" s(const char32_t *str, size_t len); u32string operator "" s(const char32_t *str, size_t len);
} }
namespace literals {
using namespace string_literals;
} }
} }

View File

@ -0,0 +1,3 @@
#pragma once
struct stat;

View File

@ -0,0 +1,4 @@
#pragma once
struct timeval;
struct fd_set;

View File

@ -0,0 +1,17 @@
#pragma once
#include <stdtypedefs.h>
typedef unsigned int id_t;
typedef unsigned int gid_t;
typedef unsigned int uid_t;
typedef int pid_t;
typedef long int off_t;
typedef unsigned int mode_t;
typedef unsigned long ino_t;
typedef long int dev_t;
typedef void *timer_t;
typedef int clockid_t;
typedef unsigned int useconds_t;
typedef long int suseconds_t;

View File

@ -0,0 +1,5 @@
#pragma once
class type_info;
class bad_cast;
class bad_typeid;

View File

@ -0,0 +1,10 @@
#pragma once
#include <stdio.h>
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
extern char *optarg;
extern int optind, opterr, optopt;

View File

@ -0,0 +1 @@
#include <ogg/ogg.h>

View File

@ -1 +1,9 @@
struct OggVorbis_File; #ifndef _OV_FILE_H
#define _OV_FILE_H
#include <stdio.h>
#include "codec.h"
typedef struct OggVorbis_File OggVorbis_File;
#endif

View File

@ -0,0 +1,19 @@
#ifndef ZCONF_H
#define ZCONF_H
typedef unsigned char Byte;
typedef unsigned int uInt;
typedef unsigned long uLong;
typedef char charf;
typedef int intf;
typedef uInt uIntf;
typedef uLong uLongf;
typedef void const *voidpc;
typedef void *voidpf;
typedef void *voidp;
typedef unsigned long z_crc_t;
#endif

View File

@ -20,6 +20,8 @@
#ifndef ZLIB_H #ifndef ZLIB_H
#define ZLIB_H #define ZLIB_H
#include "zconf.h"
class z_stream { class z_stream {
}; };

View File

@ -19,7 +19,10 @@
// This module is not compiled if OpenSSL is not available. // This module is not compiled if OpenSSL is not available.
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#ifndef OPENSSL_NO_KRB5
#define OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5
#endif
#include "referenceCount.h" #include "referenceCount.h"
#include "openSSLWrapper.h" // must be included before any other openssl. #include "openSSLWrapper.h" // must be included before any other openssl.

View File

@ -19,7 +19,10 @@
// This module is not compiled if OpenSSL is not available. // This module is not compiled if OpenSSL is not available.
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#ifndef OPENSSL_NO_KRB5
#define OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5
#endif
#include "bioPtr.h" #include "bioPtr.h"
#include "pointerTo.h" #include "pointerTo.h"

View File

@ -19,7 +19,10 @@
// This module is not compiled if OpenSSL is not available. // This module is not compiled if OpenSSL is not available.
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#ifndef OPENSSL_NO_KRB5
#define OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5
#endif
#include "bioStream.h" #include "bioStream.h"
#include "referenceCount.h" #include "referenceCount.h"

View File

@ -23,7 +23,10 @@
// communications. // communications.
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#ifndef OPENSSL_NO_KRB5
#define OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5
#endif
#include "httpClient.h" #include "httpClient.h"
#include "httpEnum.h" #include "httpEnum.h"

View File

@ -24,7 +24,10 @@
#include <winsock2.h> // must be included prior to including OpenSSL. #include <winsock2.h> // must be included prior to including OpenSSL.
#endif #endif
#ifndef OPENSSL_NO_KRB5
#define OPENSSL_NO_KRB5 #define OPENSSL_NO_KRB5
#endif
#include "openssl/ssl.h" #include "openssl/ssl.h"
#include "openssl/rand.h" #include "openssl/rand.h"
#include "openssl/err.h" #include "openssl/err.h"

View File

@ -607,6 +607,8 @@ xform(const FLOATNAME(LVecBase3) &v) const {
return v_res; return v_res;
} }
#undef VECTOR3_MATRIX3_PRODUCT
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: LMatrix3::xform_point // Function: LMatrix3::xform_point
// Access: Published // Access: Published
@ -811,6 +813,8 @@ multiply(const FLOATNAME(LMatrix3) &other1, const FLOATNAME(LMatrix3) &other2) {
MATRIX3_PRODUCT((*this), other1, other2); MATRIX3_PRODUCT((*this), other1, other2);
} }
#undef MATRIX3_PRODUCT
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: LMatrix3::matrix * scalar // Function: LMatrix3::matrix * scalar
// Access: Published // Access: Published
@ -1235,6 +1239,9 @@ invert_transpose_from(const FLOATNAME(LMatrix4) &other) {
#endif // HAVE_EIGEN #endif // HAVE_EIGEN
} }
#undef MATRIX3_DETERMINANT
#undef DET2
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: LMatrix::set_translate_mat // Function: LMatrix::set_translate_mat
// Access: Published // Access: Published

View File

@ -849,6 +849,8 @@ xform(const FLOATNAME(LVecBase4) &v) const {
return v_res; return v_res;
} }
#undef VECTOR4_MATRIX4_PRODUCT
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: LMatrix4::xform_point // Function: LMatrix4::xform_point
// Access: Public // Access: Public
@ -1068,6 +1070,8 @@ multiply(const FLOATNAME(LMatrix4) &other1, const FLOATNAME(LMatrix4) &other2) {
#endif // HAVE_EIGEN #endif // HAVE_EIGEN
} }
#undef MATRIX4_PRODUCT
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: LMatrix4::matrix * scalar // Function: LMatrix4::matrix * scalar
// Access: Public // Access: Public

View File

@ -8,10 +8,15 @@
const int ALL_OK = 0; const int ALL_OK = 0;
const int BASIC_ERROR = -1; const int BASIC_ERROR = -1;
#if defined(CPPPARSER)
// Interrogate doesn't need to parse any of this.
typedef unsigned long SOCKET;
/************************************************************************ /************************************************************************
* HP SOCKET LIBRARY STUFF * HP SOCKET LIBRARY STUFF
************************************************************************/ ************************************************************************/
#if defined(HP_SOCK) #elif defined(HP_SOCK)
#ifndef _INCLUDE_HPUX_SOURCE #ifndef _INCLUDE_HPUX_SOURCE
#define _INCLUDE_HPUX_SOURCE #define _INCLUDE_HPUX_SOURCE

View File

@ -28,7 +28,7 @@
#include <Iphlpapi.h> // For GetAdaptersAddresses() #include <Iphlpapi.h> // For GetAdaptersAddresses()
#elif defined(ANDROID) #elif defined(ANDROID)
#include <net/if.h> #include <net/if.h>
#else #elif !defined(CPPPARSER)
#include <net/if.h> #include <net/if.h>
#include <ifaddrs.h> #include <ifaddrs.h>
#endif #endif

View File

@ -10,9 +10,6 @@ ignoretype Factory<TypedWriteable>
# builds (to support multi-arch builds), so we don't export this. # builds (to support multi-arch builds), so we don't export this.
ignoretype BitMaskNative ignoretype BitMaskNative
forcetype basic_string<char>
renametype basic_string<char> CString
forcetype PointerToBase<ReferenceCountedVector<ushort> > forcetype PointerToBase<ReferenceCountedVector<ushort> >
forcetype PointerToArrayBase<ushort> forcetype PointerToArrayBase<ushort>
forcetype PointerToArray<ushort> forcetype PointerToArray<ushort>

View File

@ -20,9 +20,11 @@
#include "keyboardButton.h" #include "keyboardButton.h"
#include "mouseButton.h" #include "mouseButton.h"
#ifndef CPPPARSER
#include <Rocket/Core/Input.h> #include <Rocket/Core/Input.h>
using namespace Rocket::Core::Input; using namespace Rocket::Core::Input;
#endif
TypeHandle RocketInputHandler::_type_handle; TypeHandle RocketInputHandler::_type_handle;

View File

@ -14,7 +14,7 @@
#include "webcamVideoV4L.h" #include "webcamVideoV4L.h"
#ifdef HAVE_VIDEO4LINUX #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER)
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>

View File

@ -17,7 +17,7 @@
#include "pandabase.h" #include "pandabase.h"
#ifdef HAVE_VIDEO4LINUX #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER)
#include "webcamVideo.h" #include "webcamVideo.h"
#include "movieVideoCursor.h" #include "movieVideoCursor.h"

View File

@ -14,7 +14,7 @@
#include "webcamVideoV4L.h" #include "webcamVideoV4L.h"
#ifdef HAVE_VIDEO4LINUX #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER)
#include "webcamVideoCursorV4L.h" #include "webcamVideoCursorV4L.h"
#include "dcast.h" #include "dcast.h"

View File

@ -17,7 +17,7 @@
#include "pandabase.h" #include "pandabase.h"
#ifdef HAVE_VIDEO4LINUX #if defined(HAVE_VIDEO4LINUX) && !defined(CPPPARSER)
#include "webcamVideo.h" #include "webcamVideo.h"