Use "static inline" instead of "extern inline" for now.

pull/13171/head
Joshua Haberman 16 years ago
parent 2da3b081c4
commit 1139650320
  1. 2
      Makefile
  2. 11
      upb.h
  3. 2
      upb_msg.h

@ -4,7 +4,7 @@ CC=gcc
CXX=g++ CXX=g++
CFLAGS=-std=c99 CFLAGS=-std=c99
CPPFLAGS=-O3 -Wall -Wextra -pedantic -g -DNDEBUG -DUPB_UNALIGNED_READS_OK -fomit-frame-pointer CPPFLAGS=-O3 -Wall -Wextra -pedantic -g -DNDEBUG -DUPB_UNALIGNED_READS_OK -fomit-frame-pointer
OBJ=upb_parse.o upb_table.o upb_msg.o upb_context.o descriptor.o upb_inlinedefs.o OBJ=upb_parse.o upb_table.o upb_msg.o upb_context.o descriptor.o
all: $(OBJ) test_table tests all: $(OBJ) test_table tests
clean: clean:
rm -f $(OBJ) tests rm -f $(OBJ) tests

11
upb.h

@ -16,15 +16,8 @@
extern "C" { extern "C" {
#endif #endif
/* Portable inlining strategy: use C99 rules except on GCC. /* inline if possible, emit standalone code if required. */
* see: http://www.greenend.org.uk/rjk/2003/03/inline.html. */ #define INLINE static inline
#ifndef INLINE
# if __GNUC__ && !__GNUC_STDC_INLINE__
# define INLINE extern inline
# else
# define INLINE inline
# endif
#endif
/* The maximum that any submessages can be nested. Matches proto2's limit. */ /* The maximum that any submessages can be nested. Matches proto2's limit. */
#define UPB_MAX_NESTING 64 #define UPB_MAX_NESTING 64

@ -96,7 +96,7 @@ struct upb_fieldsbyname_entry {
struct upb_abbrev_msg_field f; struct upb_abbrev_msg_field f;
}; };
struct upb_msg_field *upb_get_msg_field( INLINE struct upb_msg_field *upb_get_msg_field(
struct upb_abbrev_msg_field *f, struct upb_msg *m) { struct upb_abbrev_msg_field *f, struct upb_msg *m) {
return &m->fields[f->field_index]; return &m->fields[f->field_index];
} }

Loading…
Cancel
Save