Opened 15 years ago

Closed 15 years ago

Last modified 4 years ago

#252 closed defect (fixed)

size_t not declared in geos_c.h

Reported by: mloskot Owned by: pramsey
Priority: major Milestone: 3.1.1
Component: C API Version: main
Severity: Unassigned Keywords: header, cstddef, size_t
Cc:

Description (last modified by mloskot)

If GEOS C API header is included in C++ program it does not compile using C++ compiler because size_t is not declared. Here is test program:

#include <geos_c.h>

int main()
{
    return 0;
}

compile and notice errors:

mloskot@dog:~/dev/geos/_svn/trunk/tests/unit$  g++ -DHAVE_CONFIG_H -I. -I../../source/headers -I../../source/headers/geos -I../../source/headers -I../../tests/unit/tut -I../../capi    -g -O2 -DGEOS_INLINE  -pedantic -Wall -ansi -Wno-long-long  -ffloat-store -c -o test.o test.cpp
In file included from test.cpp:1:
../../capi/geos_c.h:190: error: ‘size_t’ has not been declared
../../capi/geos_c.h:191: error: ‘size_t’ has not been declared
../../capi/geos_c.h:193: error: ‘size_t’ has not been declared
../../capi/geos_c.h:194: error: ‘size_t’ has not been declared
../../capi/geos_c.h:202: error: ‘size_t’ has not been declared
../../capi/geos_c.h:205: error: ‘size_t’ has not been declared
../../capi/geos_c.h:209: error: ‘size_t’ has not been declared
../../capi/geos_c.h:212: error: ‘size_t’ has not been declared
../../capi/geos_c.h:746: error: ‘size_t’ has not been declared
../../capi/geos_c.h:747: error: ‘size_t’ has not been declared
../../capi/geos_c.h:756: error: ‘size_t’ has not been declared
../../capi/geos_c.h:761: error: ‘size_t’ has not been declared
../../capi/geos_c.h:773: error: ‘size_t’ has not been declared
../../capi/geos_c.h:774: error: ‘size_t’ has not been declared
../../capi/geos_c.h:780: error: ‘size_t’ has not been declared
../../capi/geos_c.h:785: error: ‘size_t’ has not been declared
make[1]: *** [test.o] Error 1
make[1]: Leaving directory `/home/mloskot/dev/geos/_svn/trunk/tests/unit'
make: *** [check-am] Error 2
mloskot@dog:~/dev/geos/_svn/trunk/tests/unit$ 

This problem applies to geos_c.h in branch 3.0 and 3.1.

Attachments (1)

fix-ticket-252-r2445.patch (334 bytes ) - added by mloskot 15 years ago.
Fix for not declared size_t in geos_c.h

Download all attachments as: .zip

Change History (7)

by mloskot, 15 years ago

Attachment: fix-ticket-252-r2445.patch added

Fix for not declared size_t in geos_c.h

comment:1 by mloskot, 15 years ago

Description: modified (diff)

comment:2 by mloskot, 15 years ago

Description: modified (diff)

comment:3 by strk, 15 years ago

Ah, now I see what you were talking about in the other bug... I'm applying your patch now.

comment:4 by strk, 15 years ago

Committed in r2500 (beer anyone?)

comment:5 by strk, 15 years ago

Resolution: fixed
Status: newclosed

comment:6 by Paul Ramsey <pramsey@…>, 4 years ago

In d23eb6c/git:

Remove DoubleBits in favour of exp2 and frexp
Closes #252, Closes #317

Note: See TracTickets for help on using tickets.