Announcement

Collapse
No announcement yet.

Fehler in der Deklarationssyntax einer inline-Funktion

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fehler in der Deklarationssyntax einer inline-Funktion

    Moin

    Habe wieder ein Problem, bei dem ich Hilfe brauch.
    Und zwar gibt mir der Compiler bei der Funktion
    Code:
    inline unsigned int
    exif_tag_table_count (void)
    {
    	return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]);
    }
    die Fehlermeldung
    Code:
    Fehler in der Deklarationssyntax
    .

    Die Funktion ist in C geschrieben und Bestandteil eines Packages.

    Bei der nachfolgenden Funktion erscheint der gleiche Fehler:
    Code:
    static inline ExifShort
    exif_get_short_convert (const unsigned char *buf, ExifFormat format,
    			ExifByteOrder order)
    {
    	switch (format) {
    	case EXIF_FORMAT_LONG:
    		return (ExifShort) exif_get_long (buf, order);
    	case EXIF_FORMAT_SLONG:
    		return (ExifShort) exif_get_slong (buf, order);
    	case EXIF_FORMAT_SHORT:
    		return (ExifShort) exif_get_short (buf, order);
    	case EXIF_FORMAT_SSHORT:
    		return (ExifShort) exif_get_sshort (buf, order);
    	case EXIF_FORMAT_BYTE:
    	case EXIF_FORMAT_SBYTE:
    		return (ExifShort) buf[0];
    	default:
    		/* Unsupported type */
    		return (ExifShort) 0;
    	}
    }
    Bitte um Hilfe.

    Grüße
    mez

    PS: Ich vermute, es liegt am inline. Allerdings weiß ich nicht, warum.

  • #2
    inline heisst nur, dass die Funktion an dieser Stelle im Code direkt eingefügt wird. Damit entfällt der Sprung.
    Christian

    Comment


    • #3
      Ja, weiß ich wohl. Deswegen ist es ja so merkwürdig. Ich habe nun das inline mal rausgenommen (zur Probe) und dann funktioniert es. Die Fehler kamen bei jeder inline-Funktion

      Comment


      • #4
        Ich bin mir nicht sicher. Aber ich glaube das inline eine c++-Funktionalität ist und nicht jeder C-Compiler unterstützt inline. Warum nimmst Du kein Macro?

        Comment


        • #5
          Nein, inline ist in C durchaus vorhanden
          Christian

          Comment

          Working...
          X