unittest_proto3_bad_macros.proto 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2023 Google Inc. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file or at
  6. // https://developers.google.com/open-source/licenses/bsd
  7. syntax = "proto3";
  8. package protobuf_unittest;
  9. option csharp_namespace = "ProtobufUnittest";
  10. option java_multiple_files = true;
  11. option java_package = "com.google.protobuf.testing.proto";
  12. // `google/protobuf/port_def.inc` #undef's a number of inconvenient macros
  13. // defined in system headers under varying circumstances. The code generated
  14. // from this file will not compile if those `#undef` calls are accidentally
  15. // removed.
  16. // This generates `GID_MAX`, which is a macro in some circumstances.
  17. enum GID {
  18. GID_UNUSED = 0;
  19. }
  20. // This generates `UID_MAX`, which is a mcro in some circumstances.
  21. enum UID {
  22. UID_UNUSED = 0;
  23. }
  24. // Just a container for bad macro names. Some of these do not follow the normal
  25. // naming conventions, this is intentional, we just want to trigger a build
  26. // failure if the macro is left defined.
  27. enum BadNames {
  28. // autoheader defines this in some circumstances.
  29. PACKAGE = 0;
  30. // The comment says "a few common headers define this".
  31. PACKED = 1;
  32. // Defined in many Linux system headers.
  33. linux = 2;
  34. // This is often a macro in `<math.h>`.
  35. DOMAIN = 3;
  36. // These are defined in both Windows and macOS headers.
  37. TRUE = 4;
  38. FALSE = 5;
  39. // Sometimes defined in Windows system headers.
  40. CREATE_NEW = 6;
  41. DELETE = 7;
  42. DOUBLE_CLICK = 8;
  43. ERROR = 9;
  44. ERROR_BUSY = 10;
  45. ERROR_INSTALL_FAILED = 11;
  46. ERROR_NOT_FOUND = 12;
  47. GetClassName = 13;
  48. GetCurrentTime = 14;
  49. GetMessage = 15;
  50. GetObject = 16;
  51. IGNORE = 17;
  52. IN = 18;
  53. INPUT_KEYBOARD = 19;
  54. NO_ERROR = 20;
  55. OUT = 21;
  56. OPTIONAL = 22;
  57. NEAR = 23;
  58. NO_DATA = 24;
  59. REASON_UNKNOWN = 25;
  60. SERVICE_DISABLED = 26;
  61. SEVERITY_ERROR = 27;
  62. STATUS_PENDING = 28;
  63. STRICT = 29;
  64. // Sometimed defined in macOS system headers.
  65. TYPE_BOOL = 30;
  66. // Defined in macOS, Windows, and Linux headers.
  67. DEBUG = 31;
  68. }